
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/functions/special.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:26:08 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Special &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="special.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Geometry" href="../geometry/index.html" />
    <link rel="prev" title="Combinatorial" href="combinatorial.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../geometry/index.html" title="Geometry"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="combinatorial.html" title="Combinatorial"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Functions</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Special</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <section id="special">
<h1>Special<a class="headerlink" href="#special" title="Permalink to this headline">¶</a></h1>
<section id="diracdelta">
<h2>DiracDelta<a class="headerlink" href="#diracdelta" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.DiracDelta">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.delta_functions.</span></span><span class="sig-name descname"><span class="pre">DiracDelta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/delta_functions.py#L17-L394"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.delta_functions.DiracDelta" title="Permalink to this definition">¶</a></dt>
<dd><p>The DiracDelta function and its derivatives.</p>
<p class="rubric">Explanation</p>
<p>DiracDelta is not an ordinary function. It can be rigorously defined either
as a distribution or as a measure.</p>
<p>DiracDelta only makes sense in definite integrals, and in particular,
integrals of the form <code class="docutils literal notranslate"><span class="pre">Integral(f(x)*DiracDelta(x</span> <span class="pre">-</span> <span class="pre">x0),</span> <span class="pre">(x,</span> <span class="pre">a,</span> <span class="pre">b))</span></code>,
where it equals <code class="docutils literal notranslate"><span class="pre">f(x0)</span></code> if <code class="docutils literal notranslate"><span class="pre">a</span> <span class="pre">&lt;=</span> <span class="pre">x0</span> <span class="pre">&lt;=</span> <span class="pre">b</span></code> and <code class="docutils literal notranslate"><span class="pre">0</span></code> otherwise. Formally,
DiracDelta acts in some ways like a function that is <code class="docutils literal notranslate"><span class="pre">0</span></code> everywhere except
at <code class="docutils literal notranslate"><span class="pre">0</span></code>, but in many ways it also does not. It can often be useful to treat
DiracDelta in formal ways, building up and manipulating expressions with
delta functions (which may eventually be integrated), but care must be taken
to not treat it as a real function. SymPy’s <code class="docutils literal notranslate"><span class="pre">oo</span></code> is similar. It only
truly makes sense formally in certain contexts (such as integration limits),
but SymPy allows its use everywhere, and it tries to be consistent with
operations on it (like <code class="docutils literal notranslate"><span class="pre">1/oo</span></code>), but it is easy to get into trouble and get
wrong results if <code class="docutils literal notranslate"><span class="pre">oo</span></code> is treated too much like a number. Similarly, if
DiracDelta is treated too much like a function, it is easy to get wrong or
nonsensical results.</p>
<p>DiracDelta function has the following properties:</p>
<ol class="arabic simple">
<li><p><span class="math notranslate nohighlight">\(\frac{d}{d x} \theta(x) = \delta(x)\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\int_{-\infty}^\infty \delta(x - a)f(x)\, dx = f(a)\)</span> and <span class="math notranslate nohighlight">\(\int_{a-
\epsilon}^{a+\epsilon} \delta(x - a)f(x)\, dx = f(a)\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\delta(x) = 0\)</span> for all <span class="math notranslate nohighlight">\(x \neq 0\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\delta(g(x)) = \sum_i \frac{\delta(x - x_i)}{\|g'(x_i)\|}\)</span> where <span class="math notranslate nohighlight">\(x_i\)</span>
are the roots of <span class="math notranslate nohighlight">\(g\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\delta(-x) = \delta(x)\)</span></p></li>
</ol>
<p>Derivatives of <code class="docutils literal notranslate"><span class="pre">k</span></code>-th order of DiracDelta have the following properties:</p>
<ol class="arabic simple" start="6">
<li><p><span class="math notranslate nohighlight">\(\delta(x, k) = 0\)</span> for all <span class="math notranslate nohighlight">\(x \neq 0\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\delta(-x, k) = -\delta(x, k)\)</span> for odd <span class="math notranslate nohighlight">\(k\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\delta(-x, k) = \delta(x, k)\)</span> for even <span class="math notranslate nohighlight">\(k\)</span></p></li>
</ol>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">DiracDelta</span><span class="p">,</span> <span class="n">diff</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">DiracDelta(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">4</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="go">DiracDelta(0)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">DiracDelta(x, 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span><span class="n">x</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span>
<span class="go">DiracDelta(x - 1, 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">),</span><span class="n">x</span><span class="p">,</span><span class="mi">2</span><span class="p">)</span>
<span class="go">2*(2*x**2*DiracDelta(x**2 - 1, 2) + DiracDelta(x**2 - 1, 1))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">is_simple</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">is_simple</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">((</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">diracdelta</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">wrt</span><span class="o">=</span><span class="n">x</span><span class="p">)</span>
<span class="go">DiracDelta(x - 1)/(2*Abs(y)) + DiracDelta(x + 1)/(2*Abs(y))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.delta_functions.Heaviside" title="sympy.functions.special.delta_functions.Heaviside"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Heaviside</span></code></a>, <a class="reference internal" href="../simplify/simplify.html#sympy.simplify.simplify.simplify" title="sympy.simplify.simplify.simplify"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.simplify.simplify.simplify</span></code></a>, <a class="reference internal" href="#sympy.functions.special.delta_functions.DiracDelta.is_simple" title="sympy.functions.special.delta_functions.DiracDelta.is_simple"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_simple</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta" title="sympy.functions.special.tensor_functions.KroneckerDelta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.functions.special.tensor_functions.KroneckerDelta</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r284"><span class="brackets"><a class="fn-backref" href="#id1">R284</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/DeltaFunction.html">http://mathworld.wolfram.com/DeltaFunction.html</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.DiracDelta.eval">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/delta_functions.py#L151-L232"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.delta_functions.DiracDelta.eval" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a simplified form or a value of DiracDelta depending on the
argument passed by the DiracDelta object.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>k</strong> : integer</p>
<blockquote>
<div><p>order of derivative</p>
</div></blockquote>
<p><strong>arg</strong> : argument passed to DiracDelta</p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The <code class="docutils literal notranslate"><span class="pre">eval()</span></code> method is automatically called when the <code class="docutils literal notranslate"><span class="pre">DiracDelta</span></code>
class is about to be instantiated and it returns either some simplified
instance or the unevaluated instance depending on the argument passed.
In other words, <code class="docutils literal notranslate"><span class="pre">eval()</span></code> method is not needed to be called explicitly,
it is being called and evaluated once the object is called.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">DiracDelta</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">DiracDelta(x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">-DiracDelta(x, 1)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">DiracDelta(0)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">S</span><span class="o">.</span><span class="n">NaN</span><span class="p">)</span>
<span class="go">nan</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">eval</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">100</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">100</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">100</span><span class="p">)</span>
<span class="go">DiracDelta(0)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.DiracDelta.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/delta_functions.py#L103-L149"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.delta_functions.DiracDelta.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the first derivative of a DiracDelta Function.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>argindex</strong> : integer</p>
<blockquote>
<div><p>degree of derivative</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The difference between <code class="docutils literal notranslate"><span class="pre">diff()</span></code> and <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> is: <code class="docutils literal notranslate"><span class="pre">diff()</span></code> is the
user-level function and <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> is an object method. <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> is
a convenience method available in the <code class="docutils literal notranslate"><span class="pre">Function</span></code> class. It returns
the derivative of the function without considering the chain rule.
<code class="docutils literal notranslate"><span class="pre">diff(function,</span> <span class="pre">x)</span></code> calls <code class="docutils literal notranslate"><span class="pre">Function._eval_derivative</span></code> which in turn
calls <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> internally to compute the derivative of the function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">DiracDelta</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">fdiff</span><span class="p">()</span>
<span class="go">DiracDelta(x, 1)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">fdiff</span><span class="p">()</span>
<span class="go">DiracDelta(x, 2)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">fdiff</span><span class="p">()</span>
<span class="go">DiracDelta(x**2 - 1, 1)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">fdiff</span><span class="p">()</span>
<span class="go">DiracDelta(x, 3)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.DiracDelta.is_simple">
<span class="sig-name descname"><span class="pre">is_simple</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/delta_functions.py#L307-L343"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.delta_functions.DiracDelta.is_simple" title="Permalink to this definition">¶</a></dt>
<dd><p>Tells whether the argument(args[0]) of DiracDelta is a linear
expression in <em>x</em>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>x</strong> : can be a symbol</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">DiracDelta</span><span class="p">,</span> <span class="n">cos</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">is_simple</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">)</span><span class="o">.</span><span class="n">is_simple</span><span class="p">(</span><span class="n">y</span><span class="p">)</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">+</span> <span class="n">x</span> <span class="o">-</span> <span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">is_simple</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">DiracDelta</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">x</span><span class="p">))</span><span class="o">.</span><span class="n">is_simple</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../simplify/simplify.html#sympy.simplify.simplify.simplify" title="sympy.simplify.simplify.simplify"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.simplify.simplify.simplify</span></code></a>, <a class="reference internal" href="#sympy.functions.special.delta_functions.DiracDelta" title="sympy.functions.special.delta_functions.DiracDelta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DiracDelta</span></code></a></p>
</div>
</dd></dl>

</dd></dl>

</section>
<section id="heaviside">
<h2>Heaviside<a class="headerlink" href="#heaviside" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.Heaviside">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.delta_functions.</span></span><span class="sig-name descname"><span class="pre">Heaviside</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">H0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span> <span class="pre">/</span> <span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/delta_functions.py#L402-L678"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.delta_functions.Heaviside" title="Permalink to this definition">¶</a></dt>
<dd><p>Heaviside step function.</p>
<p class="rubric">Explanation</p>
<p>The Heaviside step function has the following properties:</p>
<ol class="arabic simple">
<li><p><span class="math notranslate nohighlight">\(\frac{d}{d x} \theta(x) = \delta(x)\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\theta(x) = \begin{cases} 0 &amp; \text{for}\: x &lt; 0 \\ \frac{1}{2} &amp;
\text{for}\: x = 0 \\1 &amp; \text{for}\: x &gt; 0 \end{cases}\)</span></p></li>
<li><p><span class="math notranslate nohighlight">\(\frac{d}{d x} \max(x, 0) = \theta(x)\)</span></p></li>
</ol>
<p>Heaviside(x) is printed as <span class="math notranslate nohighlight">\(\theta(x)\)</span> with the SymPy LaTeX printer.</p>
<p>The value at 0 is set differently in different fields. SymPy uses 1/2,
which is a convention from electronics and signal processing, and is
consistent with solving improper integrals by Fourier transform and
convolution.</p>
<p>To specify a different value of Heaviside at <code class="docutils literal notranslate"><span class="pre">x=0</span></code>, a second argument
can be given. Using <code class="docutils literal notranslate"><span class="pre">Heaviside(x,</span> <span class="pre">nan)</span></code> gives an expression that will
evaluate to nan for x=0.</p>
<div class="versionchanged">
<p><span class="versionmodified changed">Changed in version 1.9: </span><code class="docutils literal notranslate"><span class="pre">Heaviside(0)</span></code> now returns 1/2 (before: undefined)</p>
</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Heaviside</span><span class="p">,</span> <span class="n">nan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="mi">9</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="o">-</span><span class="mi">9</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">nan</span><span class="p">)</span>
<span class="go">nan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="p">(</span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="go">Heaviside(x, 1) + 1</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.delta_functions.DiracDelta" title="sympy.functions.special.delta_functions.DiracDelta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DiracDelta</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r285"><span class="brackets"><a class="fn-backref" href="#id2">R285</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/HeavisideStepFunction.html">http://mathworld.wolfram.com/HeavisideStepFunction.html</a></p>
</dd>
<dt class="label" id="r286"><span class="brackets"><a class="fn-backref" href="#id3">R286</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/1.16#iv">http://dlmf.nist.gov/1.16#iv</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.Heaviside.eval">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">H0</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span> <span class="pre">/</span> <span class="pre">2</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/delta_functions.py#L504-L571"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.delta_functions.Heaviside.eval" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a simplified form or a value of Heaviside depending on the
argument passed by the Heaviside object.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>arg</strong> : argument passed by Heaviside object</p>
<p><strong>H0</strong> : value of Heaviside(0)</p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>The <code class="docutils literal notranslate"><span class="pre">eval()</span></code> method is automatically called when the <code class="docutils literal notranslate"><span class="pre">Heaviside</span></code>
class is about to be instantiated and it returns either some simplified
instance or the unevaluated instance depending on the argument passed.
In other words, <code class="docutils literal notranslate"><span class="pre">eval()</span></code> method is not needed to be called explicitly,
it is being called and evaluated once the object is called.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Heaviside</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">Heaviside(x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="mi">19</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">1/2</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="o">-</span><span class="mi">5</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="n">S</span><span class="o">.</span><span class="n">NaN</span><span class="p">)</span>
<span class="go">nan</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">eval</span><span class="p">(</span><span class="mi">42</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">100</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span> <span class="o">-</span> <span class="mi">100</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">105</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.Heaviside.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/delta_functions.py#L460-L489"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.delta_functions.Heaviside.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the first derivative of a Heaviside Function.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>argindex</strong> : integer</p>
<blockquote>
<div><p>order of derivative</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Heaviside</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">fdiff</span><span class="p">()</span>
<span class="go">DiracDelta(x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">fdiff</span><span class="p">()</span>
<span class="go">DiracDelta(x**2 - 1)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">Heaviside</span><span class="p">(</span><span class="n">x</span><span class="p">))</span><span class="o">.</span><span class="n">fdiff</span><span class="p">()</span>
<span class="go">DiracDelta(x, 1)</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.delta_functions.Heaviside.pargs">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">pargs</span></span><a class="headerlink" href="#sympy.functions.special.delta_functions.Heaviside.pargs" title="Permalink to this definition">¶</a></dt>
<dd><p>Args without default S.Half</p>
</dd></dl>

</dd></dl>

</section>
<section id="module-sympy.functions.special.singularity_functions">
<span id="singularity-function"></span><h2>Singularity Function<a class="headerlink" href="#module-sympy.functions.special.singularity_functions" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.singularity_functions.SingularityFunction">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.singularity_functions.</span></span><span class="sig-name descname"><span class="pre">SingularityFunction</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">variable</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exponent</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/singularity_functions.py#L14-L236"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.singularity_functions.SingularityFunction" title="Permalink to this definition">¶</a></dt>
<dd><p>Singularity functions are a class of discontinuous functions.</p>
<p class="rubric">Explanation</p>
<p>Singularity functions take a variable, an offset, and an exponent as
arguments. These functions are represented using Macaulay brackets as:</p>
<p>SingularityFunction(x, a, n) := &lt;x - a&gt;^n</p>
<p>The singularity function will automatically evaluate to
<code class="docutils literal notranslate"><span class="pre">Derivative(DiracDelta(x</span> <span class="pre">-</span> <span class="pre">a),</span> <span class="pre">x,</span> <span class="pre">-n</span> <span class="pre">-</span> <span class="pre">1)</span></code> if <code class="docutils literal notranslate"><span class="pre">n</span> <span class="pre">&lt;</span> <span class="pre">0</span></code>
and <code class="docutils literal notranslate"><span class="pre">(x</span> <span class="pre">-</span> <span class="pre">a)**n*Heaviside(x</span> <span class="pre">-</span> <span class="pre">a)</span></code> if <code class="docutils literal notranslate"><span class="pre">n</span> <span class="pre">&gt;=</span> <span class="pre">0</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">SingularityFunction</span><span class="p">,</span> <span class="n">diff</span><span class="p">,</span> <span class="n">Piecewise</span><span class="p">,</span> <span class="n">DiracDelta</span><span class="p">,</span> <span class="n">Heaviside</span><span class="p">,</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="go">SingularityFunction(x, a, n)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;y&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">,</span> <span class="n">nonnegative</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="go">(y + 10)**n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;y&#39;</span><span class="p">,</span> <span class="n">negative</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">y</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">10</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">10</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="go">243</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span> <span class="o">+</span> <span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">4</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">4*SingularityFunction(x, 1, 3) + 5*SingularityFunction(x, 1, 4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">SingularityFunction(x, 4, -2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Piecewise</span><span class="p">)</span>
<span class="go">Piecewise(((x - 4)**5, x - 4 &gt; 0), (0, True))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span> <span class="o">=</span> <span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;y&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">,</span> <span class="n">nonnegative</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span><span class="o">.</span><span class="n">subs</span><span class="p">({</span><span class="n">x</span><span class="p">:</span> <span class="n">y</span><span class="p">,</span> <span class="n">a</span><span class="p">:</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="n">n</span><span class="p">:</span> <span class="n">n</span><span class="p">})</span>
<span class="go">(y + 10)**n</span>
</pre></div>
</div>
<p>The methods <code class="docutils literal notranslate"><span class="pre">rewrite(DiracDelta)</span></code>, <code class="docutils literal notranslate"><span class="pre">rewrite(Heaviside)</span></code>, and
<code class="docutils literal notranslate"><span class="pre">rewrite('HeavisideDiracDelta')</span></code> returns the same output. One can use any
of these methods according to their choice.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span> <span class="o">=</span> <span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span> <span class="o">+</span> <span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="mi">3</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="o">-</span> <span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Heaviside</span><span class="p">)</span>
<span class="go">(x - 4)**5*Heaviside(x - 4) + DiracDelta(x + 3) - DiracDelta(x, 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">DiracDelta</span><span class="p">)</span>
<span class="go">(x - 4)**5*Heaviside(x - 4) + DiracDelta(x + 3) - DiracDelta(x, 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expr</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="s1">&#39;HeavisideDiracDelta&#39;</span><span class="p">)</span>
<span class="go">(x - 4)**5*Heaviside(x - 4) + DiracDelta(x + 3) - DiracDelta(x, 1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.delta_functions.DiracDelta" title="sympy.functions.special.delta_functions.DiracDelta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DiracDelta</span></code></a>, <a class="reference internal" href="#sympy.functions.special.delta_functions.Heaviside" title="sympy.functions.special.delta_functions.Heaviside"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Heaviside</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r287"><span class="brackets"><a class="fn-backref" href="#id4">R287</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Singularity_function">https://en.wikipedia.org/wiki/Singularity_function</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.singularity_functions.SingularityFunction.eval">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">variable</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">offset</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">exponent</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/singularity_functions.py#L115-L181"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.singularity_functions.SingularityFunction.eval" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a simplified form or a value of Singularity Function depending
on the argument passed by the object.</p>
<p class="rubric">Explanation</p>
<p>The <code class="docutils literal notranslate"><span class="pre">eval()</span></code> method is automatically called when the
<code class="docutils literal notranslate"><span class="pre">SingularityFunction</span></code> class is about to be instantiated and it
returns either some simplified instance or the unevaluated instance
depending on the argument passed. In other words, <code class="docutils literal notranslate"><span class="pre">eval()</span></code> method is
not needed to be called explicitly, it is being called and evaluated
once the object is called.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">SingularityFunction</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">nan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="go">SingularityFunction(x, a, n)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">nan</span><span class="p">)</span>
<span class="go">nan</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">subs</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span><span class="o">.</span><span class="n">eval</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span><span class="o">.</span><span class="n">eval</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">5</span><span class="p">)</span>
<span class="go">243</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">,</span> <span class="n">positive</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">negative</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;n&#39;</span><span class="p">,</span> <span class="n">nonnegative</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="go">(-a + x)**n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">,</span> <span class="n">negative</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">positive</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">SingularityFunction</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.singularity_functions.SingularityFunction.fdiff">
<span class="sig-name descname"><span class="pre">fdiff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/singularity_functions.py#L88-L113"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.singularity_functions.SingularityFunction.fdiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the first derivative of a DiracDelta Function.</p>
<p class="rubric">Explanation</p>
<p>The difference between <code class="docutils literal notranslate"><span class="pre">diff()</span></code> and <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> is: <code class="docutils literal notranslate"><span class="pre">diff()</span></code> is the
user-level function and <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> is an object method. <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> is
a convenience method available in the <code class="docutils literal notranslate"><span class="pre">Function</span></code> class. It returns
the derivative of the function without considering the chain rule.
<code class="docutils literal notranslate"><span class="pre">diff(function,</span> <span class="pre">x)</span></code> calls <code class="docutils literal notranslate"><span class="pre">Function._eval_derivative</span></code> which in turn
calls <code class="docutils literal notranslate"><span class="pre">fdiff()</span></code> internally to compute the derivative of the function.</p>
</dd></dl>

</dd></dl>

</section>
<section id="module-sympy.functions.special.gamma_functions">
<span id="gamma-beta-and-related-functions"></span><h2>Gamma, Beta and related Functions<a class="headerlink" href="#module-sympy.functions.special.gamma_functions" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.gamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">gamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L28-L211"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.gamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The gamma function</p>
<div class="math notranslate nohighlight">
\[\Gamma(x) := \int^{\infty}_{0} t^{x-1} e^{-t} \mathrm{d}t.\]</div>
<p class="rubric">Explanation</p>
<p>The <code class="docutils literal notranslate"><span class="pre">gamma</span></code> function implements the function which passes through the
values of the factorial function (i.e., <span class="math notranslate nohighlight">\(\Gamma(n) = (n - 1)!\)</span> when n is
an integer). More generally, <span class="math notranslate nohighlight">\(\Gamma(z)\)</span> is defined in the whole complex
plane except at the negative integers where there are simple poles.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">gamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">gamma</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gamma</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="go">6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gamma</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">sqrt(pi)/2</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">gamma</span></code> function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">gamma</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">gamma(conjugate(x))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(x\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">gamma</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">gamma(x)*polygamma(0, x)</span>
</pre></div>
</div>
<p>Series expansion is also supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">series</span><span class="p">(</span><span class="n">gamma</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">1/x - EulerGamma + x*(EulerGamma**2/2 + pi**2/12) + x**2*(-EulerGamma*pi**2/12 + polygamma(2, 1)/6 - EulerGamma**3/6) + O(x**3)</span>
</pre></div>
</div>
<p>We can numerically evaluate the <code class="docutils literal notranslate"><span class="pre">gamma</span></code> function to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">gamma</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span>
<span class="go">2.288037795340032417959588909060233922890</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gamma</span><span class="p">(</span><span class="mi">1</span><span class="o">+</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<span class="go">0.49801566811835604271 - 0.15494982830181068512*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a></dt><dd><p>Lower incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a></dt><dd><p>Polygamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a></dt><dd><p>Log Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a></dt><dd><p>Digamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a></dt><dd><p>Trigamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></dt><dd><p>Euler Beta function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r288"><span class="brackets"><a class="fn-backref" href="#id5">R288</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gamma_function">https://en.wikipedia.org/wiki/Gamma_function</a></p>
</dd>
<dt class="label" id="r289"><span class="brackets"><a class="fn-backref" href="#id6">R289</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/5">http://dlmf.nist.gov/5</a></p>
</dd>
<dt class="label" id="r290"><span class="brackets"><a class="fn-backref" href="#id7">R290</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/GammaFunction.html">http://mathworld.wolfram.com/GammaFunction.html</a></p>
</dd>
<dt class="label" id="r291"><span class="brackets"><a class="fn-backref" href="#id8">R291</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Gamma/">http://functions.wolfram.com/GammaBetaErf/Gamma/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.loggamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">loggamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L856-L1050"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.loggamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">loggamma</span></code> function implements the logarithm of the
gamma function (i.e., <span class="math notranslate nohighlight">\(\log\Gamma(x)\)</span>).</p>
<p class="rubric">Examples</p>
<p>Several special values are known. For numerical integral
arguments we have:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">loggamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span>
<span class="go">log(2)</span>
</pre></div>
</div>
<p>And for symbolic values:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;n&quot;</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="n">n</span><span class="p">)</span>
<span class="go">log(gamma(n))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="o">-</span><span class="n">n</span><span class="p">)</span>
<span class="go">oo</span>
</pre></div>
</div>
<p>For half-integral values:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">log(3*sqrt(pi)/4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="n">n</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span>
<span class="go">log(2**(1 - n)*sqrt(pi)*gamma(n)/gamma(n/2 + 1/2))</span>
</pre></div>
</div>
<p>And general rational arguments:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">loggamma</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">16</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">L</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">-5*log(3) + loggamma(1/3) + log(4) + log(7) + log(10) + log(13)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">loggamma</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">19</span><span class="p">)</span><span class="o">/</span><span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">L</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">-4*log(4) + loggamma(3/4) + log(3) + log(7) + log(11) + log(15)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">L</span> <span class="o">=</span> <span class="n">loggamma</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">23</span><span class="p">)</span><span class="o">/</span><span class="mi">7</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">L</span><span class="p">)</span><span class="o">.</span><span class="n">doit</span><span class="p">()</span>
<span class="go">-3*log(7) + log(2) + loggamma(2/7) + log(9) + log(16)</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">loggamma</span></code> function has the following limits towards infinity:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">zoo</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">loggamma</span></code> function obeys the mirror symmetry
if <span class="math notranslate nohighlight">\(x \in \mathbb{C} \setminus \{-\infty, 0\}\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">loggamma</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">loggamma(conjugate(x))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(x\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">loggamma</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">polygamma(0, x)</span>
</pre></div>
</div>
<p>Series expansion is also supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">series</span><span class="p">(</span><span class="n">loggamma</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span><span class="o">.</span><span class="n">cancel</span><span class="p">()</span>
<span class="go">-log(x) - EulerGamma*x + pi**2*x**2/12 + x**3*polygamma(2, 1)/6 + O(x**4)</span>
</pre></div>
</div>
<p>We can numerically evaluate the <code class="docutils literal notranslate"><span class="pre">gamma</span></code> function to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">3.17805383034794561964694160130</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">loggamma</span><span class="p">(</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<span class="go">-0.65092319930185633889 - 1.8724366472624298171*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a></dt><dd><p>Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a></dt><dd><p>Lower incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a></dt><dd><p>Polygamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a></dt><dd><p>Digamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a></dt><dd><p>Trigamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></dt><dd><p>Euler Beta function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r292"><span class="brackets"><a class="fn-backref" href="#id9">R292</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gamma_function">https://en.wikipedia.org/wiki/Gamma_function</a></p>
</dd>
<dt class="label" id="r293"><span class="brackets"><a class="fn-backref" href="#id10">R293</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/5">http://dlmf.nist.gov/5</a></p>
</dd>
<dt class="label" id="r294"><span class="brackets"><a class="fn-backref" href="#id11">R294</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/LogGammaFunction.html">http://mathworld.wolfram.com/LogGammaFunction.html</a></p>
</dd>
<dt class="label" id="r295"><span class="brackets"><a class="fn-backref" href="#id12">R295</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/LogGamma/">http://functions.wolfram.com/GammaBetaErf/LogGamma/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.polygamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">polygamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L559-L853"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.polygamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The function <code class="docutils literal notranslate"><span class="pre">polygamma(n,</span> <span class="pre">z)</span></code> returns <code class="docutils literal notranslate"><span class="pre">log(gamma(z)).diff(n</span> <span class="pre">+</span> <span class="pre">1)</span></code>.</p>
<p class="rubric">Explanation</p>
<p>It is a meromorphic function on <span class="math notranslate nohighlight">\(\mathbb{C}\)</span> and defined as the <span class="math notranslate nohighlight">\((n+1)\)</span>-th
derivative of the logarithm of the gamma function:</p>
<div class="math notranslate nohighlight">
\[\psi^{(n)} (z) := \frac{\mathrm{d}^{n+1}}{\mathrm{d} z^{n+1}} \log\Gamma(z).\]</div>
<p class="rubric">Examples</p>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span><span class="p">,</span> <span class="n">polygamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">-EulerGamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">S</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">-2*log(2) - EulerGamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">S</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="go">-log(3) - sqrt(3)*pi/6 - EulerGamma - log(sqrt(3))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">S</span><span class="p">(</span><span class="mi">4</span><span class="p">))</span>
<span class="go">-pi/2 - log(4) - log(2) - EulerGamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">1 - EulerGamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">23</span><span class="p">)</span>
<span class="go">19093197/5173168 - EulerGamma</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="o">-</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(x\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;x&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">polygamma(1, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">polygamma(2, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">polygamma(3, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">polygamma(2, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">polygamma(3, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">polygamma(3, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">polygamma(4, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">n</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;n&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">polygamma(n + 1, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">polygamma</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">polygamma(n + 2, x)</span>
</pre></div>
</div>
<p>We can rewrite <code class="docutils literal notranslate"><span class="pre">polygamma</span></code> functions in terms of harmonic numbers:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">harmonic</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">harmonic</span><span class="p">)</span>
<span class="go">harmonic(x - 1) - EulerGamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">harmonic</span><span class="p">)</span>
<span class="go">2*harmonic(x - 1, 3) - 2*zeta(3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ni</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;n&quot;</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polygamma</span><span class="p">(</span><span class="n">ni</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">harmonic</span><span class="p">)</span>
<span class="go">(-1)**(n + 1)*(-harmonic(x - 1, n + 1) + zeta(n + 1))*factorial(n)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a></dt><dd><p>Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a></dt><dd><p>Lower incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a></dt><dd><p>Log Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a></dt><dd><p>Digamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a></dt><dd><p>Trigamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></dt><dd><p>Euler Beta function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r296"><span class="brackets"><a class="fn-backref" href="#id13">R296</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Polygamma_function">https://en.wikipedia.org/wiki/Polygamma_function</a></p>
</dd>
<dt class="label" id="r297"><span class="brackets"><a class="fn-backref" href="#id14">R297</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/PolygammaFunction.html">http://mathworld.wolfram.com/PolygammaFunction.html</a></p>
</dd>
<dt class="label" id="r298"><span class="brackets"><a class="fn-backref" href="#id15">R298</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/PolyGamma/">http://functions.wolfram.com/GammaBetaErf/PolyGamma/</a></p>
</dd>
<dt class="label" id="r299"><span class="brackets"><a class="fn-backref" href="#id16">R299</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/PolyGamma2/">http://functions.wolfram.com/GammaBetaErf/PolyGamma2/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.digamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">digamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L1053-L1142"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.digamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">digamma</span></code> function is the first derivative of the <code class="docutils literal notranslate"><span class="pre">loggamma</span></code>
function</p>
<div class="math notranslate nohighlight">
\[\psi(x) := \frac{\mathrm{d}}{\mathrm{d} z} \log\Gamma(z)
        = \frac{\Gamma'(z)}{\Gamma(z) }.\]</div>
<p>In this case, <code class="docutils literal notranslate"><span class="pre">digamma(z)</span> <span class="pre">=</span> <span class="pre">polygamma(0,</span> <span class="pre">z)</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">digamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">digamma</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">zoo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;z&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">digamma</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">polygamma(0, z)</span>
</pre></div>
</div>
<p>To retain <code class="docutils literal notranslate"><span class="pre">digamma</span></code> as it is:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">digamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">evaluate</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">digamma(0)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">digamma</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">evaluate</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">digamma(z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a></dt><dd><p>Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a></dt><dd><p>Lower incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a></dt><dd><p>Polygamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a></dt><dd><p>Log Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a></dt><dd><p>Trigamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></dt><dd><p>Euler Beta function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r300"><span class="brackets"><a class="fn-backref" href="#id17">R300</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Digamma_function">https://en.wikipedia.org/wiki/Digamma_function</a></p>
</dd>
<dt class="label" id="r301"><span class="brackets"><a class="fn-backref" href="#id18">R301</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/DigammaFunction.html">http://mathworld.wolfram.com/DigammaFunction.html</a></p>
</dd>
<dt class="label" id="r302"><span class="brackets"><a class="fn-backref" href="#id19">R302</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/PolyGamma2/">http://functions.wolfram.com/GammaBetaErf/PolyGamma2/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.trigamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">trigamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L1146-L1238"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.trigamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The <code class="docutils literal notranslate"><span class="pre">trigamma</span></code> function is the second derivative of the <code class="docutils literal notranslate"><span class="pre">loggamma</span></code>
function</p>
<div class="math notranslate nohighlight">
\[\psi^{(1)}(z) := \frac{\mathrm{d}^{2}}{\mathrm{d} z^{2}} \log\Gamma(z).\]</div>
<p>In this case, <code class="docutils literal notranslate"><span class="pre">trigamma(z)</span> <span class="pre">=</span> <span class="pre">polygamma(1,</span> <span class="pre">z)</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">trigamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trigamma</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">zoo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;z&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trigamma</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">polygamma(1, z)</span>
</pre></div>
</div>
<p>To retain <code class="docutils literal notranslate"><span class="pre">trigamma</span></code> as it is:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">trigamma</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">evaluate</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">trigamma(0)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">trigamma</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">evaluate</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">trigamma(z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a></dt><dd><p>Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a></dt><dd><p>Lower incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a></dt><dd><p>Polygamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a></dt><dd><p>Log Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a></dt><dd><p>Digamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></dt><dd><p>Euler Beta function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r303"><span class="brackets"><a class="fn-backref" href="#id20">R303</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigamma_function">https://en.wikipedia.org/wiki/Trigamma_function</a></p>
</dd>
<dt class="label" id="r304"><span class="brackets"><a class="fn-backref" href="#id21">R304</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/TrigammaFunction.html">http://mathworld.wolfram.com/TrigammaFunction.html</a></p>
</dd>
<dt class="label" id="r305"><span class="brackets"><a class="fn-backref" href="#id22">R305</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/PolyGamma2/">http://functions.wolfram.com/GammaBetaErf/PolyGamma2/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.uppergamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">uppergamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L397-L552"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.uppergamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The upper incomplete gamma function.</p>
<p class="rubric">Explanation</p>
<p>It can be defined as the meromorphic continuation of</p>
<div class="math notranslate nohighlight">
\[\Gamma(s, x) := \int_x^\infty t^{s-1} e^{-t} \mathrm{d}t = \Gamma(s) - \gamma(s, x).\]</div>
<p>where <span class="math notranslate nohighlight">\(\gamma(s, x)\)</span> is the lower incomplete gamma function,
<a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-class docutils literal notranslate"><span class="pre">lowergamma</span></code></a>. This can be shown to be the same as</p>
<div class="math notranslate nohighlight">
\[\Gamma(s, x) = \Gamma(s) - \frac{x^s}{s} {}_1F_1\left({s \atop s+1} \middle| -x\right),\]</div>
<p>where <span class="math notranslate nohighlight">\({}_1F_1\)</span> is the (confluent) hypergeometric function.</p>
<p>The upper incomplete gamma function is also essentially equivalent to the
generalized exponential integral:</p>
<div class="math notranslate nohighlight">
\[\operatorname{E}_{n}(x) = \int_{1}^{\infty}{\frac{e^{-xt}}{t^n} \, dt} = x^{n-1}\Gamma(1-n,x).\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">uppergamma</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">uppergamma</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">uppergamma(s, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">uppergamma</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*(x**2/2 + x + 1)*exp(-x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">uppergamma</span><span class="p">(</span><span class="o">-</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-2*sqrt(pi)*erfc(sqrt(x)) + 2*exp(-x)/sqrt(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">uppergamma</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">expint(3, x)/x**2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a></dt><dd><p>Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a></dt><dd><p>Lower incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a></dt><dd><p>Polygamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a></dt><dd><p>Log Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a></dt><dd><p>Digamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a></dt><dd><p>Trigamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></dt><dd><p>Euler Beta function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r306"><span class="brackets"><a class="fn-backref" href="#id23">R306</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Incomplete_gamma_function#Upper_incomplete_Gamma_function">https://en.wikipedia.org/wiki/Incomplete_gamma_function#Upper_incomplete_Gamma_function</a></p>
</dd>
<dt class="label" id="r307"><span class="brackets"><a class="fn-backref" href="#id24">R307</a></span></dt>
<dd><p>Abramowitz, Milton; Stegun, Irene A., eds. (1965), Chapter 6,
Section 5, Handbook of Mathematical Functions with Formulas, Graphs,
and Mathematical Tables</p>
</dd>
<dt class="label" id="r308"><span class="brackets"><a class="fn-backref" href="#id25">R308</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/8">http://dlmf.nist.gov/8</a></p>
</dd>
<dt class="label" id="r309"><span class="brackets"><a class="fn-backref" href="#id26">R309</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Gamma2/">http://functions.wolfram.com/GammaBetaErf/Gamma2/</a></p>
</dd>
<dt class="label" id="r310"><span class="brackets"><a class="fn-backref" href="#id27">R310</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Gamma3/">http://functions.wolfram.com/GammaBetaErf/Gamma3/</a></p>
</dd>
<dt class="label" id="r311"><span class="brackets"><a class="fn-backref" href="#id28">R311</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Exponential_integral#Relation_with_other_functions">https://en.wikipedia.org/wiki/Exponential_integral#Relation_with_other_functions</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.lowergamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">lowergamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L218-L394"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.lowergamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The lower incomplete gamma function.</p>
<p class="rubric">Explanation</p>
<p>It can be defined as the meromorphic continuation of</p>
<div class="math notranslate nohighlight">
\[\gamma(s, x) := \int_0^x t^{s-1} e^{-t} \mathrm{d}t = \Gamma(s) - \Gamma(s, x).\]</div>
<p>This can be shown to be the same as</p>
<div class="math notranslate nohighlight">
\[\gamma(s, x) = \frac{x^s}{s} {}_1F_1\left({s \atop s+1} \middle| -x\right),\]</div>
<p>where <span class="math notranslate nohighlight">\({}_1F_1\)</span> is the (confluent) hypergeometric function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">lowergamma</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span><span class="p">,</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lowergamma</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">lowergamma(s, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lowergamma</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-2*(x**2/2 + x + 1)*exp(-x) + 2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lowergamma</span><span class="p">(</span><span class="o">-</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-2*sqrt(pi)*erf(sqrt(x)) - 2*exp(-x)/sqrt(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a></dt><dd><p>Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a></dt><dd><p>Polygamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a></dt><dd><p>Log Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a></dt><dd><p>Digamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a></dt><dd><p>Trigamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></dt><dd><p>Euler Beta function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r312"><span class="brackets"><a class="fn-backref" href="#id29">R312</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Incomplete_gamma_function#Lower_incomplete_Gamma_function">https://en.wikipedia.org/wiki/Incomplete_gamma_function#Lower_incomplete_Gamma_function</a></p>
</dd>
<dt class="label" id="r313"><span class="brackets"><a class="fn-backref" href="#id30">R313</a></span></dt>
<dd><p>Abramowitz, Milton; Stegun, Irene A., eds. (1965), Chapter 6,
Section 5, Handbook of Mathematical Functions with Formulas, Graphs,
and Mathematical Tables</p>
</dd>
<dt class="label" id="r314"><span class="brackets"><a class="fn-backref" href="#id31">R314</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/8">http://dlmf.nist.gov/8</a></p>
</dd>
<dt class="label" id="r315"><span class="brackets"><a class="fn-backref" href="#id32">R315</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Gamma2/">http://functions.wolfram.com/GammaBetaErf/Gamma2/</a></p>
</dd>
<dt class="label" id="r316"><span class="brackets"><a class="fn-backref" href="#id33">R316</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Gamma3/">http://functions.wolfram.com/GammaBetaErf/Gamma3/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.gamma_functions.multigamma">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.gamma_functions.</span></span><span class="sig-name descname"><span class="pre">multigamma</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">p</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/gamma_functions.py#L1246-L1336"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.gamma_functions.multigamma" title="Permalink to this definition">¶</a></dt>
<dd><p>The multivariate gamma function is a generalization of the gamma function</p>
<div class="math notranslate nohighlight">
\[\Gamma_p(z) = \pi^{p(p-1)/4}\prod_{k=1}^p \Gamma[z + (1 - k)/2].\]</div>
<p>In a special case, <code class="docutils literal notranslate"><span class="pre">multigamma(x,</span> <span class="pre">1)</span> <span class="pre">=</span> <span class="pre">gamma(x)</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>p</strong> : order or dimension of the multivariate gamma function</p>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span><span class="p">,</span> <span class="n">multigamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">,</span> <span class="n">positive</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">multigamma</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span>
<span class="go">pi**(p*(p - 1)/4)*Product(gamma(-_k/2 + x + 1/2), (_k, 1, p))</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">multigamma</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">multigamma</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">multigamma</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">sqrt(pi)/2</span>
</pre></div>
</div>
<p>Writing <code class="docutils literal notranslate"><span class="pre">multigamma</span></code> in terms of the <code class="docutils literal notranslate"><span class="pre">gamma</span></code> function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">multigamma</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">gamma(x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">multigamma</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">sqrt(pi)*gamma(x)*gamma(x - 1/2)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">multigamma</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">pi**(3/2)*gamma(x)*gamma(x - 1)*gamma(x - 1/2)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.beta_functions.beta" title="sympy.functions.special.beta_functions.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r317"><span class="brackets"><a class="fn-backref" href="#id34">R317</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Multivariate_gamma_function">https://en.wikipedia.org/wiki/Multivariate_gamma_function</a></p>
</dd>
</dl>
</dd></dl>

<span class="target" id="module-sympy.functions.special.beta_functions"></span><dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.beta_functions.beta">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.beta_functions.</span></span><span class="sig-name descname"><span class="pre">beta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/beta_functions.py#L19-L144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.beta_functions.beta" title="Permalink to this definition">¶</a></dt>
<dd><p>The beta integral is called the Eulerian integral of the first kind by
Legendre:</p>
<div class="math notranslate nohighlight">
\[\mathrm{B}(x,y)  \int^{1}_{0} t^{x-1} (1-t)^{y-1} \mathrm{d}t.\]</div>
<p class="rubric">Explanation</p>
<p>The Beta function or Euler’s first integral is closely associated
with the gamma function. The Beta function is often used in probability
theory and mathematical statistics. It satisfies properties like:</p>
<div class="math notranslate nohighlight">
\[\begin{split}\mathrm{B}(a,1) = \frac{1}{a} \\
\mathrm{B}(a,b) = \mathrm{B}(b,a)  \\
\mathrm{B}(a,b) = \frac{\Gamma(a) \Gamma(b)}{\Gamma(a+b)}\end{split}\]</div>
<p>Therefore for integral values of <span class="math notranslate nohighlight">\(a\)</span> and <span class="math notranslate nohighlight">\(b\)</span>:</p>
<div class="math notranslate nohighlight">
\[\mathrm{B} = \frac{(a-1)! (b-1)!}{(a+b-1)!}\]</div>
<p>A special case of the Beta function when <span class="math notranslate nohighlight">\(x = y\)</span> is the
Central Beta function. It satisfies properties like:</p>
<div class="math notranslate nohighlight">
\[\mathrm{B}(x) = 2^{1 - 2x}\mathrm{B}(x, \frac{1}{2})
\mathrm{B}(x) = 2^{1 - 2x} cos(\pi x) \mathrm{B}(\frac{1}{2} - x, x)
\mathrm{B}(x) = \int_{0}^{1} \frac{t^x}{(1 + t)^{2x}} dt
\mathrm{B}(x) = \frac{2}{x} \prod_{n = 1}^{\infty} \frac{n(n + 2x)}{(n + x)^2}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<p>The Beta function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">beta</span><span class="p">,</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">beta</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span>
<span class="go">beta(conjugate(x), conjugate(y))</span>
</pre></div>
</div>
<p>Differentiation with respect to both <span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(y\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">beta</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">beta</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">(polygamma(0, x) - polygamma(0, x + y))*beta(x, y)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">beta</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">),</span> <span class="n">y</span><span class="p">)</span>
<span class="go">(polygamma(0, y) - polygamma(0, x + y))*beta(x, y)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">beta</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*(polygamma(0, x) - polygamma(0, 2*x))*beta(x, x)</span>
</pre></div>
</div>
<p>We can numerically evaluate the Beta function to
arbitrary precision for any complex numbers x and y:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">beta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">beta</span><span class="p">(</span><span class="n">pi</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">40</span><span class="p">)</span>
<span class="go">0.02671848900111377452242355235388489324562</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">beta</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<span class="go">-0.2112723729365330143 - 0.7655283165378005676*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a></dt><dd><p>Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.lowergamma" title="sympy.functions.special.gamma_functions.lowergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lowergamma</span></code></a></dt><dd><p>Lower incomplete gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.polygamma" title="sympy.functions.special.gamma_functions.polygamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polygamma</span></code></a></dt><dd><p>Polygamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.loggamma" title="sympy.functions.special.gamma_functions.loggamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">loggamma</span></code></a></dt><dd><p>Log Gamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.digamma" title="sympy.functions.special.gamma_functions.digamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">digamma</span></code></a></dt><dd><p>Digamma function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.trigamma" title="sympy.functions.special.gamma_functions.trigamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">trigamma</span></code></a></dt><dd><p>Trigamma function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r318"><span class="brackets"><a class="fn-backref" href="#id35">R318</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Beta_function">https://en.wikipedia.org/wiki/Beta_function</a></p>
</dd>
<dt class="label" id="r319"><span class="brackets"><a class="fn-backref" href="#id36">R319</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/BetaFunction.html">http://mathworld.wolfram.com/BetaFunction.html</a></p>
</dd>
<dt class="label" id="r320"><span class="brackets"><a class="fn-backref" href="#id37">R320</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/5.12">http://dlmf.nist.gov/5.12</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-sympy.functions.special.error_functions">
<span id="error-functions-and-fresnel-integrals"></span><h2>Error Functions and Fresnel Integrals<a class="headerlink" href="#module-sympy.functions.special.error_functions" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erf">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">erf</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L42-L266"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erf" title="Permalink to this definition">¶</a></dt>
<dd><p>The Gauss error function.</p>
<p class="rubric">Explanation</p>
<p>This function is defined as:</p>
<div class="math notranslate nohighlight">
\[\mathrm{erf}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{-t^2} \mathrm{d}t.\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">erf</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-oo*I</span>
</pre></div>
</div>
<p>In general one can pull out factors of -1 and <span class="math notranslate nohighlight">\(I\)</span> from the argument:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="o">-</span><span class="n">z</span><span class="p">)</span>
<span class="go">-erf(z)</span>
</pre></div>
</div>
<p>The error function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">erf</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">erf(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erf</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">2*exp(-z**2)/sqrt(pi)</span>
</pre></div>
</div>
<p>We can numerically evaluate the error function to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">0.999999984582742099719981147840</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erf</span><span class="p">(</span><span class="o">-</span><span class="mi">4</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">-1296959.73071763923152794095062*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfc" title="sympy.functions.special.error_functions.erfc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfc</span></code></a></dt><dd><p>Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfi" title="sympy.functions.special.error_functions.erfi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfi</span></code></a></dt><dd><p>Imaginary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2" title="sympy.functions.special.error_functions.erf2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2</span></code></a></dt><dd><p>Two-argument error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfinv" title="sympy.functions.special.error_functions.erfinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfinv</span></code></a></dt><dd><p>Inverse error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfcinv" title="sympy.functions.special.error_functions.erfcinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfcinv</span></code></a></dt><dd><p>Inverse Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2inv" title="sympy.functions.special.error_functions.erf2inv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2inv</span></code></a></dt><dd><p>Inverse two-argument error function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r321"><span class="brackets"><a class="fn-backref" href="#id38">R321</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Error_function">https://en.wikipedia.org/wiki/Error_function</a></p>
</dd>
<dt class="label" id="r322"><span class="brackets"><a class="fn-backref" href="#id39">R322</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/7">http://dlmf.nist.gov/7</a></p>
</dd>
<dt class="label" id="r323"><span class="brackets"><a class="fn-backref" href="#id40">R323</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/Erf.html">http://mathworld.wolfram.com/Erf.html</a></p>
</dd>
<dt class="label" id="r324"><span class="brackets"><a class="fn-backref" href="#id41">R324</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Erf">http://functions.wolfram.com/GammaBetaErf/Erf</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erf.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L128-L133"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erf.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erfc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">erfc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L269-L457"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erfc" title="Permalink to this definition">¶</a></dt>
<dd><p>Complementary Error Function.</p>
<p class="rubric">Explanation</p>
<p>The function is defined as:</p>
<div class="math notranslate nohighlight">
\[\mathrm{erfc}(x) = \frac{2}{\sqrt{\pi}} \int_x^\infty e^{-t^2} \mathrm{d}t\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">erfc</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-oo*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo*I</span>
</pre></div>
</div>
<p>The error function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">erfc</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">erfc(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erfc</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">-2*exp(-z**2)/sqrt(pi)</span>
</pre></div>
</div>
<p>It also follows</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="o">-</span><span class="n">z</span><span class="p">)</span>
<span class="go">2 - erfc(z)</span>
</pre></div>
</div>
<p>We can numerically evaluate the complementary error function to arbitrary
precision on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">0.0000000154172579002800188521596734869</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfc</span><span class="p">(</span><span class="mi">4</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">1.0 - 1296959.73071763923152794095062*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf" title="sympy.functions.special.error_functions.erf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf</span></code></a></dt><dd><p>Gaussian error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfi" title="sympy.functions.special.error_functions.erfi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfi</span></code></a></dt><dd><p>Imaginary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2" title="sympy.functions.special.error_functions.erf2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2</span></code></a></dt><dd><p>Two-argument error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfinv" title="sympy.functions.special.error_functions.erfinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfinv</span></code></a></dt><dd><p>Inverse error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfcinv" title="sympy.functions.special.error_functions.erfcinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfcinv</span></code></a></dt><dd><p>Inverse Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2inv" title="sympy.functions.special.error_functions.erf2inv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2inv</span></code></a></dt><dd><p>Inverse two-argument error function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r325"><span class="brackets"><a class="fn-backref" href="#id42">R325</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Error_function">https://en.wikipedia.org/wiki/Error_function</a></p>
</dd>
<dt class="label" id="r326"><span class="brackets"><a class="fn-backref" href="#id43">R326</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/7">http://dlmf.nist.gov/7</a></p>
</dd>
<dt class="label" id="r327"><span class="brackets"><a class="fn-backref" href="#id44">R327</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/Erfc.html">http://mathworld.wolfram.com/Erfc.html</a></p>
</dd>
<dt class="label" id="r328"><span class="brackets"><a class="fn-backref" href="#id45">R328</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Erfc">http://functions.wolfram.com/GammaBetaErf/Erfc</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erfc.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L354-L359"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erfc.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erfi">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">erfi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L460-L650"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erfi" title="Permalink to this definition">¶</a></dt>
<dd><p>Imaginary error function.</p>
<p class="rubric">Explanation</p>
<p>The function erfi is defined as:</p>
<div class="math notranslate nohighlight">
\[\mathrm{erfi}(x) = \frac{2}{\sqrt{\pi}} \int_0^x e^{t^2} \mathrm{d}t\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">erfi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-I</span>
</pre></div>
</div>
<p>In general one can pull out factors of -1 and <span class="math notranslate nohighlight">\(I\)</span> from the argument:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="o">-</span><span class="n">z</span><span class="p">)</span>
<span class="go">-erfi(z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">erfi</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">erfi(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erfi</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">2*exp(z**2)/sqrt(pi)</span>
</pre></div>
</div>
<p>We can numerically evaluate the imaginary error function to arbitrary
precision on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">18.5648024145755525987042919132</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfi</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">-0.995322265018952734162069256367*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf" title="sympy.functions.special.error_functions.erf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf</span></code></a></dt><dd><p>Gaussian error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfc" title="sympy.functions.special.error_functions.erfc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfc</span></code></a></dt><dd><p>Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2" title="sympy.functions.special.error_functions.erf2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2</span></code></a></dt><dd><p>Two-argument error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfinv" title="sympy.functions.special.error_functions.erfinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfinv</span></code></a></dt><dd><p>Inverse error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfcinv" title="sympy.functions.special.error_functions.erfcinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfcinv</span></code></a></dt><dd><p>Inverse Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2inv" title="sympy.functions.special.error_functions.erf2inv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2inv</span></code></a></dt><dd><p>Inverse two-argument error function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r329"><span class="brackets"><a class="fn-backref" href="#id46">R329</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Error_function">https://en.wikipedia.org/wiki/Error_function</a></p>
</dd>
<dt class="label" id="r330"><span class="brackets"><a class="fn-backref" href="#id47">R330</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/Erfi.html">http://mathworld.wolfram.com/Erfi.html</a></p>
</dd>
<dt class="label" id="r331"><span class="brackets"><a class="fn-backref" href="#id48">R331</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Erfi">http://functions.wolfram.com/GammaBetaErf/Erfi</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erf2">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">erf2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L653-L795"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erf2" title="Permalink to this definition">¶</a></dt>
<dd><p>Two-argument error function.</p>
<p class="rubric">Explanation</p>
<p>This function is defined as:</p>
<div class="math notranslate nohighlight">
\[\mathrm{erf2}(x, y) = \frac{2}{\sqrt{\pi}} \int_x^y e^{-t^2} \mathrm{d}t\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span><span class="p">,</span> <span class="n">erf2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erf2</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">oo</span><span class="p">)</span>
<span class="go">1 - erf(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-erf(x) - 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2</span><span class="p">(</span><span class="n">oo</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">erf(y) - 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">erf(y) + 1</span>
</pre></div>
</div>
<p>In general one can pull out factors of -1:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erf2</span><span class="p">(</span><span class="o">-</span><span class="n">x</span><span class="p">,</span> <span class="o">-</span><span class="n">y</span><span class="p">)</span>
<span class="go">-erf2(x, y)</span>
</pre></div>
</div>
<p>The error function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">erf2</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span>
<span class="go">erf2(conjugate(x), conjugate(y))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(x\)</span>, <span class="math notranslate nohighlight">\(y\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erf2</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-2*exp(-x**2)/sqrt(pi)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erf2</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">),</span> <span class="n">y</span><span class="p">)</span>
<span class="go">2*exp(-y**2)/sqrt(pi)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf" title="sympy.functions.special.error_functions.erf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf</span></code></a></dt><dd><p>Gaussian error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfc" title="sympy.functions.special.error_functions.erfc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfc</span></code></a></dt><dd><p>Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfi" title="sympy.functions.special.error_functions.erfi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfi</span></code></a></dt><dd><p>Imaginary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfinv" title="sympy.functions.special.error_functions.erfinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfinv</span></code></a></dt><dd><p>Inverse error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfcinv" title="sympy.functions.special.error_functions.erfcinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfcinv</span></code></a></dt><dd><p>Inverse Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2inv" title="sympy.functions.special.error_functions.erf2inv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2inv</span></code></a></dt><dd><p>Inverse two-argument error function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r332"><span class="brackets"><a class="fn-backref" href="#id49">R332</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/Erf2/">http://functions.wolfram.com/GammaBetaErf/Erf2/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erfinv">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">erfinv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L798-L889"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erfinv" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverse Error Function. The erfinv function is defined as:</p>
<div class="math notranslate nohighlight">
\[\mathrm{erf}(x) = y \quad \Rightarrow \quad \mathrm{erfinv}(y) = x\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">erfinv</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfinv</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfinv</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">oo</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(x\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erfinv</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">sqrt(pi)*exp(erfinv(x)**2)/2</span>
</pre></div>
</div>
<p>We can numerically evaluate the inverse error function to arbitrary
precision on [-1, 1]:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfinv</span><span class="p">(</span><span class="mf">0.2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">0.179143454621291692285822705344</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf" title="sympy.functions.special.error_functions.erf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf</span></code></a></dt><dd><p>Gaussian error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfc" title="sympy.functions.special.error_functions.erfc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfc</span></code></a></dt><dd><p>Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfi" title="sympy.functions.special.error_functions.erfi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfi</span></code></a></dt><dd><p>Imaginary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2" title="sympy.functions.special.error_functions.erf2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2</span></code></a></dt><dd><p>Two-argument error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfcinv" title="sympy.functions.special.error_functions.erfcinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfcinv</span></code></a></dt><dd><p>Inverse Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2inv" title="sympy.functions.special.error_functions.erf2inv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2inv</span></code></a></dt><dd><p>Inverse two-argument error function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r333"><span class="brackets"><a class="fn-backref" href="#id50">R333</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Error_function#Inverse_functions">https://en.wikipedia.org/wiki/Error_function#Inverse_functions</a></p>
</dd>
<dt class="label" id="r334"><span class="brackets"><a class="fn-backref" href="#id51">R334</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/InverseErf/">http://functions.wolfram.com/GammaBetaErf/InverseErf/</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erfinv.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L855-L860"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erfinv.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erfcinv">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">erfcinv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L892-L965"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erfcinv" title="Permalink to this definition">¶</a></dt>
<dd><p>Inverse Complementary Error Function. The erfcinv function is defined as:</p>
<div class="math notranslate nohighlight">
\[\mathrm{erfc}(x) = y \quad \Rightarrow \quad \mathrm{erfcinv}(y) = x\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">erfcinv</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erfcinv</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erfcinv</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">oo</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(x\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erfcinv</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-sqrt(pi)*exp(erfcinv(x)**2)/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf" title="sympy.functions.special.error_functions.erf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf</span></code></a></dt><dd><p>Gaussian error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfc" title="sympy.functions.special.error_functions.erfc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfc</span></code></a></dt><dd><p>Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfi" title="sympy.functions.special.error_functions.erfi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfi</span></code></a></dt><dd><p>Imaginary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2" title="sympy.functions.special.error_functions.erf2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2</span></code></a></dt><dd><p>Two-argument error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfinv" title="sympy.functions.special.error_functions.erfinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfinv</span></code></a></dt><dd><p>Inverse error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2inv" title="sympy.functions.special.error_functions.erf2inv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2inv</span></code></a></dt><dd><p>Inverse two-argument error function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r335"><span class="brackets"><a class="fn-backref" href="#id52">R335</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Error_function#Inverse_functions">https://en.wikipedia.org/wiki/Error_function#Inverse_functions</a></p>
</dd>
<dt class="label" id="r336"><span class="brackets"><a class="fn-backref" href="#id53">R336</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/InverseErfc/">http://functions.wolfram.com/GammaBetaErf/InverseErfc/</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erfcinv.inverse">
<span class="sig-name descname"><span class="pre">inverse</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">argindex</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L943-L948"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erfcinv.inverse" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the inverse of this function.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.erf2inv">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">erf2inv</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L968-L1059"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.erf2inv" title="Permalink to this definition">¶</a></dt>
<dd><p>Two-argument Inverse error function. The erf2inv function is defined as:</p>
<div class="math notranslate nohighlight">
\[\mathrm{erf2}(x, w) = y \quad \Rightarrow \quad \mathrm{erf2inv}(x, y) = w\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">erf2inv</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">erf2inv</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2inv</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2inv</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2inv</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">erfinv(y)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">erf2inv</span><span class="p">(</span><span class="n">oo</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">erfcinv(-y)</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(x\)</span> and <span class="math notranslate nohighlight">\(y\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erf2inv</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">exp(-x**2 + erf2inv(x, y)**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">erf2inv</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">),</span> <span class="n">y</span><span class="p">)</span>
<span class="go">sqrt(pi)*exp(erf2inv(x, y)**2)/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf" title="sympy.functions.special.error_functions.erf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf</span></code></a></dt><dd><p>Gaussian error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfc" title="sympy.functions.special.error_functions.erfc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfc</span></code></a></dt><dd><p>Complementary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfi" title="sympy.functions.special.error_functions.erfi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfi</span></code></a></dt><dd><p>Imaginary error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erf2" title="sympy.functions.special.error_functions.erf2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erf2</span></code></a></dt><dd><p>Two-argument error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfinv" title="sympy.functions.special.error_functions.erfinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfinv</span></code></a></dt><dd><p>Inverse error function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.erfcinv" title="sympy.functions.special.error_functions.erfcinv"><code class="xref py py-obj docutils literal notranslate"><span class="pre">erfcinv</span></code></a></dt><dd><p>Inverse complementary error function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r337"><span class="brackets"><a class="fn-backref" href="#id54">R337</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/InverseErf2/">http://functions.wolfram.com/GammaBetaErf/InverseErf2/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.FresnelIntegral">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">FresnelIntegral</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L2270-L2325"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.FresnelIntegral" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for the Fresnel integrals.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.fresnels">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">fresnels</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L2328-L2481"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.fresnels" title="Permalink to this definition">¶</a></dt>
<dd><p>Fresnel integral S.</p>
<p class="rubric">Explanation</p>
<p>This function is defined by</p>
<div class="math notranslate nohighlight">
\[\operatorname{S}(z) = \int_0^z \sin{\frac{\pi}{2} t^2} \mathrm{d}t.\]</div>
<p>It is an entire function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">fresnels</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-I/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">I/2</span>
</pre></div>
</div>
<p>In general one can pull out factors of -1 and <span class="math notranslate nohighlight">\(i\)</span> from the argument:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="o">-</span><span class="n">z</span><span class="p">)</span>
<span class="go">-fresnels(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">-I*fresnels(z)</span>
</pre></div>
</div>
<p>The Fresnel S integral obeys the mirror symmetry
<span class="math notranslate nohighlight">\(\overline{S(z)} = S(\bar{z})\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">fresnels</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">fresnels(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">fresnels</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">sin(pi*z**2/2)</span>
</pre></div>
</div>
<p>Defining the Fresnel functions via an integral:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">integrate</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">sin</span><span class="p">,</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">pi</span><span class="o">*</span><span class="n">z</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">3*fresnels(z)*gamma(3/4)/(4*gamma(7/4))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">integrate</span><span class="p">(</span><span class="n">sin</span><span class="p">(</span><span class="n">pi</span><span class="o">*</span><span class="n">z</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="n">z</span><span class="p">))</span>
<span class="go">fresnels(z)</span>
</pre></div>
</div>
<p>We can numerically evaluate the Fresnel integral to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">0.343415678363698242195300815958</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnels</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">0.343415678363698242195300815958*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.fresnelc" title="sympy.functions.special.error_functions.fresnelc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fresnelc</span></code></a></dt><dd><p>Fresnel cosine integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r338"><span class="brackets"><a class="fn-backref" href="#id55">R338</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Fresnel_integral">https://en.wikipedia.org/wiki/Fresnel_integral</a></p>
</dd>
<dt class="label" id="r339"><span class="brackets"><a class="fn-backref" href="#id56">R339</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/7">http://dlmf.nist.gov/7</a></p>
</dd>
<dt class="label" id="r340"><span class="brackets"><a class="fn-backref" href="#id57">R340</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/FresnelIntegrals.html">http://mathworld.wolfram.com/FresnelIntegrals.html</a></p>
</dd>
<dt class="label" id="r341"><span class="brackets"><a class="fn-backref" href="#id58">R341</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/FresnelS">http://functions.wolfram.com/GammaBetaErf/FresnelS</a></p>
</dd>
<dt class="label" id="r342"><span class="brackets"><a class="fn-backref" href="#id59">R342</a></span></dt>
<dd><p>The converging factors for the fresnel integrals
by John W. Wrench Jr. and Vicki Alley</p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.fresnelc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">fresnelc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L2484-L2637"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.fresnelc" title="Permalink to this definition">¶</a></dt>
<dd><p>Fresnel integral C.</p>
<p class="rubric">Explanation</p>
<p>This function is defined by</p>
<div class="math notranslate nohighlight">
\[\operatorname{C}(z) = \int_0^z \cos{\frac{\pi}{2} t^2} \mathrm{d}t.\]</div>
<p>It is an entire function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">fresnelc</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">I/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="o">*</span><span class="n">oo</span><span class="p">)</span>
<span class="go">-I/2</span>
</pre></div>
</div>
<p>In general one can pull out factors of -1 and <span class="math notranslate nohighlight">\(i\)</span> from the argument:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="o">-</span><span class="n">z</span><span class="p">)</span>
<span class="go">-fresnelc(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">I*fresnelc(z)</span>
</pre></div>
</div>
<p>The Fresnel C integral obeys the mirror symmetry
<span class="math notranslate nohighlight">\(\overline{C(z)} = C(\bar{z})\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">fresnelc</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">fresnelc(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">fresnelc</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">cos(pi*z**2/2)</span>
</pre></div>
</div>
<p>Defining the Fresnel functions via an integral:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">integrate</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">pi</span><span class="o">*</span><span class="n">z</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">fresnelc(z)*gamma(1/4)/(4*gamma(5/4))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">integrate</span><span class="p">(</span><span class="n">cos</span><span class="p">(</span><span class="n">pi</span><span class="o">*</span><span class="n">z</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">2</span><span class="p">),</span> <span class="n">z</span><span class="p">))</span>
<span class="go">fresnelc(z)</span>
</pre></div>
</div>
<p>We can numerically evaluate the Fresnel integral to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">0.488253406075340754500223503357</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">fresnelc</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">-0.488253406075340754500223503357*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.fresnels" title="sympy.functions.special.error_functions.fresnels"><code class="xref py py-obj docutils literal notranslate"><span class="pre">fresnels</span></code></a></dt><dd><p>Fresnel sine integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r343"><span class="brackets"><a class="fn-backref" href="#id60">R343</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Fresnel_integral">https://en.wikipedia.org/wiki/Fresnel_integral</a></p>
</dd>
<dt class="label" id="r344"><span class="brackets"><a class="fn-backref" href="#id61">R344</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/7">http://dlmf.nist.gov/7</a></p>
</dd>
<dt class="label" id="r345"><span class="brackets"><a class="fn-backref" href="#id62">R345</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/FresnelIntegrals.html">http://mathworld.wolfram.com/FresnelIntegrals.html</a></p>
</dd>
<dt class="label" id="r346"><span class="brackets"><a class="fn-backref" href="#id63">R346</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/FresnelC">http://functions.wolfram.com/GammaBetaErf/FresnelC</a></p>
</dd>
<dt class="label" id="r347"><span class="brackets"><a class="fn-backref" href="#id64">R347</a></span></dt>
<dd><p>The converging factors for the fresnel integrals
by John W. Wrench Jr. and Vicki Alley</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="exponential-logarithmic-and-trigonometric-integrals">
<h2>Exponential, Logarithmic and Trigonometric Integrals<a class="headerlink" href="#exponential-logarithmic-and-trigonometric-integrals" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.Ei">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">Ei</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L1065-L1236"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.Ei" title="Permalink to this definition">¶</a></dt>
<dd><p>The classical exponential integral.</p>
<p class="rubric">Explanation</p>
<p>For use in SymPy, this function is defined as</p>
<div class="math notranslate nohighlight">
\[\operatorname{Ei}(x) = \sum_{n=1}^\infty \frac{x^n}{n\, n!}
+ \log(x) + \gamma,\]</div>
<p>where <span class="math notranslate nohighlight">\(\gamma\)</span> is the Euler-Mascheroni constant.</p>
<p>If <span class="math notranslate nohighlight">\(x\)</span> is a polar number, this defines an analytic function on the
Riemann surface of the logarithm. Otherwise this defines an analytic
function in the cut plane <span class="math notranslate nohighlight">\(\mathbb{C} \setminus (-\infty, 0]\)</span>.</p>
<p><strong>Background</strong></p>
<p>The name exponential integral comes from the following statement:</p>
<div class="math notranslate nohighlight">
\[\operatorname{Ei}(x) = \int_{-\infty}^x \frac{e^t}{t} \mathrm{d}t\]</div>
<p>If the integral is interpreted as a Cauchy principal value, this statement
holds for <span class="math notranslate nohighlight">\(x &gt; 0\)</span> and <span class="math notranslate nohighlight">\(\operatorname{Ei}(x)\)</span> as defined above.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ei</span><span class="p">,</span> <span class="n">polar_lift</span><span class="p">,</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ei</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">Ei(-1)</span>
</pre></div>
</div>
<p>This yields a real value:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ei</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">n</span><span class="p">(</span><span class="n">chop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">-0.219383934395520</span>
</pre></div>
</div>
<p>On the other hand the analytic continuation is not real:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ei</span><span class="p">(</span><span class="n">polar_lift</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span><span class="o">.</span><span class="n">n</span><span class="p">(</span><span class="n">chop</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">-0.21938393439552 + 3.14159265358979*I</span>
</pre></div>
</div>
<p>The exponential integral has a logarithmic branch point at the origin:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ei</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">))</span>
<span class="go">Ei(x) + 2*I*pi</span>
</pre></div>
</div>
<p>Differentiation is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ei</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">x</span><span class="p">)</span>
<span class="go">exp(x)/x</span>
</pre></div>
</div>
<p>The exponential integral is related to many other special functions.
For example:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expint</span><span class="p">,</span> <span class="n">Shi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ei</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">expint</span><span class="p">)</span>
<span class="go">-expint(1, x*exp_polar(I*pi)) - I*pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ei</span><span class="p">(</span><span class="n">x</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Shi</span><span class="p">)</span>
<span class="go">Chi(x) + Shi(x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>Special case of the generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></dt><dd><p>Upper incomplete gamma function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r348"><span class="brackets"><a class="fn-backref" href="#id65">R348</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/6.6">http://dlmf.nist.gov/6.6</a></p>
</dd>
<dt class="label" id="r349"><span class="brackets"><a class="fn-backref" href="#id66">R349</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Exponential_integral">https://en.wikipedia.org/wiki/Exponential_integral</a></p>
</dd>
<dt class="label" id="r350"><span class="brackets"><a class="fn-backref" href="#id67">R350</a></span></dt>
<dd><p>Abramowitz &amp; Stegun, section 5: <a class="reference external" href="http://people.math.sfu.ca/~cbm/aands/page_228.htm">http://people.math.sfu.ca/~cbm/aands/page_228.htm</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.expint">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">expint</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L1239-L1425"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.expint" title="Permalink to this definition">¶</a></dt>
<dd><p>Generalized exponential integral.</p>
<p class="rubric">Explanation</p>
<p>This function is defined as</p>
<div class="math notranslate nohighlight">
\[\operatorname{E}_\nu(z) = z^{\nu - 1} \Gamma(1 - \nu, z),\]</div>
<p>where <span class="math notranslate nohighlight">\(\Gamma(1 - \nu, z)\)</span> is the upper incomplete gamma function
(<code class="docutils literal notranslate"><span class="pre">uppergamma</span></code>).</p>
<p>Hence for <span class="math notranslate nohighlight">\(z\)</span> with positive real part we have</p>
<div class="math notranslate nohighlight">
\[\operatorname{E}_\nu(z)
=   \int_1^\infty \frac{e^{-zt}}{t^\nu} \mathrm{d}t,\]</div>
<p>which explains the name.</p>
<p>The representation as an incomplete gamma function provides an analytic
continuation for <span class="math notranslate nohighlight">\(\operatorname{E}_\nu(z)\)</span>. If <span class="math notranslate nohighlight">\(\nu\)</span> is a
non-positive integer, the exponential integral is thus an unbranched
function of <span class="math notranslate nohighlight">\(z\)</span>, otherwise there is a branch point at the origin.
Refer to the incomplete gamma function documentation for details of the
branching behavior.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expint</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">nu</span><span class="p">,</span> <span class="n">z</span>
</pre></div>
</div>
<p>Differentiation is supported. Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> further
explains the name: for integral orders, the exponential integral is an
iterated integral of the exponential function.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">-expint(nu - 1, z)</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(\nu\)</span> has no classical expression:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">nu</span><span class="p">)</span>
<span class="go">-z**(nu - 1)*meijerg(((), (1, 1)), ((0, 0, 1 - nu), ()), z)</span>
</pre></div>
</div>
<p>At non-postive integer orders, the exponential integral reduces to the
exponential function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">exp(-z)/z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">exp(-z)/z + exp(-z)/z**2</span>
</pre></div>
</div>
<p>At half-integers it reduces to error functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">sqrt(pi)*erfc(sqrt(z))/sqrt(z)</span>
</pre></div>
</div>
<p>At positive integer orders it can be rewritten in terms of exponentials
and <code class="docutils literal notranslate"><span class="pre">expint(1,</span> <span class="pre">z)</span></code>. Use <code class="docutils literal notranslate"><span class="pre">expand_func()</span></code> to do this:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">expint</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span> <span class="n">z</span><span class="p">))</span>
<span class="go">z**4*expint(1, z)/24 + (-z**3 + z**2 - 2*z + 6)*exp(-z)/24</span>
</pre></div>
</div>
<p>The generalised exponential integral is essentially equivalent to the
incomplete gamma function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">uppergamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">uppergamma</span><span class="p">)</span>
<span class="go">z**(nu - 1)*uppergamma(1 - nu, z)</span>
</pre></div>
</div>
<p>As such it is branched at the origin:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="mi">4</span><span class="p">,</span> <span class="n">z</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="o">*</span><span class="n">I</span><span class="p">))</span>
<span class="go">I*pi*z**3/3 + expint(4, z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expint</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">pi</span><span class="o">*</span><span class="n">I</span><span class="p">))</span>
<span class="go">z**(nu - 1)*(exp(2*I*pi*nu) - 1)*gamma(1 - nu) + expint(nu, z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Another related function called exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>The classical case, returns expint(1, z).</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
</dl>
<p><a class="reference internal" href="#sympy.functions.special.gamma_functions.uppergamma" title="sympy.functions.special.gamma_functions.uppergamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uppergamma</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r351"><span class="brackets"><a class="fn-backref" href="#id68">R351</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/8.19">http://dlmf.nist.gov/8.19</a></p>
</dd>
<dt class="label" id="r352"><span class="brackets"><a class="fn-backref" href="#id69">R352</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/GammaBetaErf/ExpIntegralE/">http://functions.wolfram.com/GammaBetaErf/ExpIntegralE/</a></p>
</dd>
<dt class="label" id="r353"><span class="brackets"><a class="fn-backref" href="#id70">R353</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Exponential_integral">https://en.wikipedia.org/wiki/Exponential_integral</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.E1">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">E1</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L1428-L1460"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.E1" title="Permalink to this definition">¶</a></dt>
<dd><p>Classical case of the generalized exponential integral.</p>
<p class="rubric">Explanation</p>
<p>This is equivalent to <code class="docutils literal notranslate"><span class="pre">expint(1,</span> <span class="pre">z)</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">E1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">E1</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">expint(1, 0)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">E1</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="go">expint(1, 5)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
</dl>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.li">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">li</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L1463-L1628"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.li" title="Permalink to this definition">¶</a></dt>
<dd><p>The classical logarithmic integral.</p>
<p class="rubric">Explanation</p>
<p>For use in SymPy, this function is defined as</p>
<div class="math notranslate nohighlight">
\[\operatorname{li}(x) = \int_0^x \frac{1}{\log(t)} \mathrm{d}t \,.\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">li</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">1/log(z)</span>
</pre></div>
</div>
<p>Defining the <code class="docutils literal notranslate"><span class="pre">li</span></code> function via an integral:
&gt;&gt;&gt; from sympy import integrate
&gt;&gt;&gt; integrate(li(z))
z*li(z) - Ei(2*log(z))</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">integrate</span><span class="p">(</span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">),</span><span class="n">z</span><span class="p">)</span>
<span class="go">z*li(z) - Ei(2*log(z))</span>
</pre></div>
</div>
<p>The logarithmic integral can also be defined in terms of <code class="docutils literal notranslate"><span class="pre">Ei</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ei</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Ei</span><span class="p">)</span>
<span class="go">Ei(log(z))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Ei</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">1/log(z)</span>
</pre></div>
</div>
<p>We can numerically evaluate the logarithmic integral to arbitrary precision
on the whole complex plane (except the singular points):</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">1.04516378011749278484458888919</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">1.0652795784357498247001125598 + 3.08346052231061726610939702133*I</span>
</pre></div>
</div>
<p>We can even compute Soldner’s constant by the help of mpmath:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">mpmath</span> <span class="kn">import</span> <span class="n">findroot</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">findroot</span><span class="p">(</span><span class="n">li</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">1.45136923488338</span>
</pre></div>
</div>
<p>Further transformations include rewriting <code class="docutils literal notranslate"><span class="pre">li</span></code> in terms of
the trigonometric integrals <code class="docutils literal notranslate"><span class="pre">Si</span></code>, <code class="docutils literal notranslate"><span class="pre">Ci</span></code>, <code class="docutils literal notranslate"><span class="pre">Shi</span></code> and <code class="docutils literal notranslate"><span class="pre">Chi</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Si</span><span class="p">,</span> <span class="n">Ci</span><span class="p">,</span> <span class="n">Shi</span><span class="p">,</span> <span class="n">Chi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Si</span><span class="p">)</span>
<span class="go">-log(I*log(z)) - log(1/log(z))/2 + log(log(z))/2 + Ci(I*log(z)) + Shi(log(z))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Ci</span><span class="p">)</span>
<span class="go">-log(I*log(z)) - log(1/log(z))/2 + log(log(z))/2 + Ci(I*log(z)) + Shi(log(z))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Shi</span><span class="p">)</span>
<span class="go">-log(1/log(z))/2 + log(log(z))/2 + Chi(log(z)) - Shi(log(z))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">li</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">Chi</span><span class="p">)</span>
<span class="go">-log(1/log(z))/2 + log(log(z))/2 + Chi(log(z)) - Shi(log(z))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>Special case of the generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r354"><span class="brackets"><a class="fn-backref" href="#id71">R354</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Logarithmic_integral">https://en.wikipedia.org/wiki/Logarithmic_integral</a></p>
</dd>
<dt class="label" id="r355"><span class="brackets"><a class="fn-backref" href="#id72">R355</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/LogarithmicIntegral.html">http://mathworld.wolfram.com/LogarithmicIntegral.html</a></p>
</dd>
<dt class="label" id="r356"><span class="brackets"><a class="fn-backref" href="#id73">R356</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/6">http://dlmf.nist.gov/6</a></p>
</dd>
<dt class="label" id="r357"><span class="brackets"><a class="fn-backref" href="#id74">R357</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/SoldnersConstant.html">http://mathworld.wolfram.com/SoldnersConstant.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.Li">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">Li</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L1630-L1720"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.Li" title="Permalink to this definition">¶</a></dt>
<dd><p>The offset logarithmic integral.</p>
<p class="rubric">Explanation</p>
<p>For use in SymPy, this function is defined as</p>
<div class="math notranslate nohighlight">
\[\operatorname{Li}(x) = \operatorname{li}(x) - \operatorname{li}(2)\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Li</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>The following special value is known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Li</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">Li</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">1/log(z)</span>
</pre></div>
</div>
<p>The shifted logarithmic integral can be written in terms of <span class="math notranslate nohighlight">\(li(z)\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">li</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Li</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">li</span><span class="p">)</span>
<span class="go">li(z) - li(2)</span>
</pre></div>
</div>
<p>We can numerically evaluate the logarithmic integral to arbitrary precision
on the whole complex plane (except the singular points):</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Li</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Li</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">30</span><span class="p">)</span>
<span class="go">1.92242131492155809316615998938</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>Special case of the generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r358"><span class="brackets"><a class="fn-backref" href="#id75">R358</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Logarithmic_integral">https://en.wikipedia.org/wiki/Logarithmic_integral</a></p>
</dd>
<dt class="label" id="r359"><span class="brackets"><a class="fn-backref" href="#id76">R359</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/LogarithmicIntegral.html">http://mathworld.wolfram.com/LogarithmicIntegral.html</a></p>
</dd>
<dt class="label" id="r360"><span class="brackets"><a class="fn-backref" href="#id77">R360</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/6">http://dlmf.nist.gov/6</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.Si">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">Si</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L1792-L1910"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.Si" title="Permalink to this definition">¶</a></dt>
<dd><p>Sine integral.</p>
<p class="rubric">Explanation</p>
<p>This function is defined by</p>
<div class="math notranslate nohighlight">
\[\operatorname{Si}(z) = \int_0^z \frac{\sin{t}}{t} \mathrm{d}t.\]</div>
<p>It is an entire function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Si</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>The sine integral is an antiderivative of <span class="math notranslate nohighlight">\(sin(z)/z\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Si</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">sin(z)/z</span>
</pre></div>
</div>
<p>It is unbranched:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Si</span><span class="p">(</span><span class="n">z</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">))</span>
<span class="go">Si(z)</span>
</pre></div>
</div>
<p>Sine integral behaves much like ordinary sine under multiplication by <code class="docutils literal notranslate"><span class="pre">I</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Si</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">I*Shi(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Si</span><span class="p">(</span><span class="o">-</span><span class="n">z</span><span class="p">)</span>
<span class="go">-Si(z)</span>
</pre></div>
</div>
<p>It can also be expressed in terms of exponential integrals, but beware
that the latter is branched:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Si</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">expint</span><span class="p">)</span>
<span class="go">-I*(-expint(1, z*exp_polar(-I*pi/2))/2 +</span>
<span class="go">     expint(1, z*exp_polar(I*pi/2))/2) + pi/2</span>
</pre></div>
</div>
<p>It can be rewritten in the form of sinc function (by definition):</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">sinc</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Si</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">sinc</span><span class="p">)</span>
<span class="go">Integral(sinc(t), (t, 0, z))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="elementary.html#sympy.functions.elementary.trigonometric.sinc" title="sympy.functions.elementary.trigonometric.sinc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sinc</span></code></a></dt><dd><p>unnormalized sinc function</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>Special case of the generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r361"><span class="brackets"><a class="fn-backref" href="#id78">R361</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_integral">https://en.wikipedia.org/wiki/Trigonometric_integral</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.Ci">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">Ci</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L1913-L2042"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.Ci" title="Permalink to this definition">¶</a></dt>
<dd><p>Cosine integral.</p>
<p class="rubric">Explanation</p>
<p>This function is defined for positive <span class="math notranslate nohighlight">\(x\)</span> by</p>
<div class="math notranslate nohighlight">
\[\operatorname{Ci}(x) = \gamma + \log{x}
              + \int_0^x \frac{\cos{t} - 1}{t} \mathrm{d}t
= -\int_x^\infty \frac{\cos{t}}{t} \mathrm{d}t,\]</div>
<p>where <span class="math notranslate nohighlight">\(\gamma\)</span> is the Euler-Mascheroni constant.</p>
<p>We have</p>
<div class="math notranslate nohighlight">
\[\operatorname{Ci}(z) =
-\frac{\operatorname{E}_1\left(e^{i\pi/2} z\right)
       + \operatorname{E}_1\left(e^{-i \pi/2} z\right)}{2}\]</div>
<p>which holds for all polar <span class="math notranslate nohighlight">\(z\)</span> and thus provides an analytic
continuation to the Riemann surface of the logarithm.</p>
<p>The formula also holds as stated
for <span class="math notranslate nohighlight">\(z \in \mathbb{C}\)</span> with <span class="math notranslate nohighlight">\(\Re(z) &gt; 0\)</span>.
By lifting to the principal branch, we obtain an analytic function on the
cut complex plane.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ci</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>The cosine integral is a primitive of <span class="math notranslate nohighlight">\(\cos(z)/z\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ci</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">cos(z)/z</span>
</pre></div>
</div>
<p>It has a logarithmic branch point at the origin:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ci</span><span class="p">(</span><span class="n">z</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">))</span>
<span class="go">Ci(z) + 2*I*pi</span>
</pre></div>
</div>
<p>The cosine integral behaves somewhat like ordinary <span class="math notranslate nohighlight">\(\cos\)</span> under
multiplication by <span class="math notranslate nohighlight">\(i\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">polar_lift</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ci</span><span class="p">(</span><span class="n">polar_lift</span><span class="p">(</span><span class="n">I</span><span class="p">)</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">Chi(z) + I*pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ci</span><span class="p">(</span><span class="n">polar_lift</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">Ci(z) + I*pi</span>
</pre></div>
</div>
<p>It can also be expressed in terms of exponential integrals:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ci</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">expint</span><span class="p">)</span>
<span class="go">-expint(1, z*exp_polar(-I*pi/2))/2 - expint(1, z*exp_polar(I*pi/2))/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>Special case of the generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r362"><span class="brackets"><a class="fn-backref" href="#id79">R362</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_integral">https://en.wikipedia.org/wiki/Trigonometric_integral</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.Shi">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">Shi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L2045-L2151"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.Shi" title="Permalink to this definition">¶</a></dt>
<dd><p>Sinh integral.</p>
<p class="rubric">Explanation</p>
<p>This function is defined by</p>
<div class="math notranslate nohighlight">
\[\operatorname{Shi}(z) = \int_0^z \frac{\sinh{t}}{t} \mathrm{d}t.\]</div>
<p>It is an entire function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Shi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>The Sinh integral is a primitive of <span class="math notranslate nohighlight">\(\sinh(z)/z\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Shi</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">sinh(z)/z</span>
</pre></div>
</div>
<p>It is unbranched:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Shi</span><span class="p">(</span><span class="n">z</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">))</span>
<span class="go">Shi(z)</span>
</pre></div>
</div>
<p>The <span class="math notranslate nohighlight">\(\sinh\)</span> integral behaves much like ordinary <span class="math notranslate nohighlight">\(\sinh\)</span> under
multiplication by <span class="math notranslate nohighlight">\(i\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Shi</span><span class="p">(</span><span class="n">I</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">I*Si(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Shi</span><span class="p">(</span><span class="o">-</span><span class="n">z</span><span class="p">)</span>
<span class="go">-Shi(z)</span>
</pre></div>
</div>
<p>It can also be expressed in terms of exponential integrals, but beware
that the latter is branched:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Shi</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">expint</span><span class="p">)</span>
<span class="go">expint(1, z)/2 - expint(1, z*exp_polar(I*pi))/2 - I*pi/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Chi" title="sympy.functions.special.error_functions.Chi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Chi</span></code></a></dt><dd><p>Hyperbolic cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>Special case of the generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r363"><span class="brackets"><a class="fn-backref" href="#id80">R363</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_integral">https://en.wikipedia.org/wiki/Trigonometric_integral</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.error_functions.Chi">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.error_functions.</span></span><span class="sig-name descname"><span class="pre">Chi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/error_functions.py#L2154-L2263"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.error_functions.Chi" title="Permalink to this definition">¶</a></dt>
<dd><p>Cosh integral.</p>
<p class="rubric">Explanation</p>
<p>This function is defined for positive <span class="math notranslate nohighlight">\(x\)</span> by</p>
<div class="math notranslate nohighlight">
\[\operatorname{Chi}(x) = \gamma + \log{x}
+ \int_0^x \frac{\cosh{t} - 1}{t} \mathrm{d}t,\]</div>
<p>where <span class="math notranslate nohighlight">\(\gamma\)</span> is the Euler-Mascheroni constant.</p>
<p>We have</p>
<div class="math notranslate nohighlight">
\[\operatorname{Chi}(z) = \operatorname{Ci}\left(e^{i \pi/2}z\right)
- i\frac{\pi}{2},\]</div>
<p>which holds for all polar <span class="math notranslate nohighlight">\(z\)</span> and thus provides an analytic
continuation to the Riemann surface of the logarithm.
By lifting to the principal branch we obtain an analytic function on the
cut complex plane.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Chi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<p>The <span class="math notranslate nohighlight">\(\cosh\)</span> integral is a primitive of <span class="math notranslate nohighlight">\(\cosh(z)/z\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Chi</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">cosh(z)/z</span>
</pre></div>
</div>
<p>It has a logarithmic branch point at the origin:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">exp_polar</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Chi</span><span class="p">(</span><span class="n">z</span><span class="o">*</span><span class="n">exp_polar</span><span class="p">(</span><span class="mi">2</span><span class="o">*</span><span class="n">I</span><span class="o">*</span><span class="n">pi</span><span class="p">))</span>
<span class="go">Chi(z) + 2*I*pi</span>
</pre></div>
</div>
<p>The <span class="math notranslate nohighlight">\(\cosh\)</span> integral behaves somewhat like ordinary <span class="math notranslate nohighlight">\(\cosh\)</span> under
multiplication by <span class="math notranslate nohighlight">\(i\)</span>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">polar_lift</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Chi</span><span class="p">(</span><span class="n">polar_lift</span><span class="p">(</span><span class="n">I</span><span class="p">)</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">Ci(z) + I*pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Chi</span><span class="p">(</span><span class="n">polar_lift</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span><span class="o">*</span><span class="n">z</span><span class="p">)</span>
<span class="go">Chi(z) + I*pi</span>
</pre></div>
</div>
<p>It can also be expressed in terms of exponential integrals:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Chi</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">expint</span><span class="p">)</span>
<span class="go">-expint(1, z)/2 - expint(1, z*exp_polar(I*pi))/2 - I*pi/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Si" title="sympy.functions.special.error_functions.Si"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Si</span></code></a></dt><dd><p>Sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ci" title="sympy.functions.special.error_functions.Ci"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ci</span></code></a></dt><dd><p>Cosine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Shi" title="sympy.functions.special.error_functions.Shi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Shi</span></code></a></dt><dd><p>Hyperbolic sine integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Ei" title="sympy.functions.special.error_functions.Ei"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ei</span></code></a></dt><dd><p>Exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.expint" title="sympy.functions.special.error_functions.expint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">expint</span></code></a></dt><dd><p>Generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.E1" title="sympy.functions.special.error_functions.E1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">E1</span></code></a></dt><dd><p>Special case of the generalised exponential integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.li" title="sympy.functions.special.error_functions.li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">li</span></code></a></dt><dd><p>Logarithmic integral.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.error_functions.Li" title="sympy.functions.special.error_functions.Li"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Li</span></code></a></dt><dd><p>Offset logarithmic integral.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r364"><span class="brackets"><a class="fn-backref" href="#id81">R364</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Trigonometric_integral">https://en.wikipedia.org/wiki/Trigonometric_integral</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-sympy.functions.special.bessel">
<span id="bessel-type-functions"></span><h2>Bessel Type Functions<a class="headerlink" href="#module-sympy.functions.special.bessel" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.BesselBase">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">BesselBase</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L29-L96"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.BesselBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for Bessel-type functions.</p>
<p>This class is meant to reduce code duplication.
All Bessel-type functions can 1) be differentiated, with the derivatives
expressed in terms of similar functions, and 2) be rewritten in terms
of other Bessel-type functions.</p>
<p>Here, Bessel-type functions are assumed to have one complex parameter.</p>
<p>To use this base class, define class attributes <code class="docutils literal notranslate"><span class="pre">_a</span></code> and <code class="docutils literal notranslate"><span class="pre">_b</span></code> such that
<code class="docutils literal notranslate"><span class="pre">2*F_n'</span> <span class="pre">=</span> <span class="pre">-_a*F_{n+1}</span> <span class="pre">+</span> <span class="pre">b*F_{n-1}</span></code>.</p>
<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.BesselBase.argument">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">argument</span></span><a class="headerlink" href="#sympy.functions.special.bessel.BesselBase.argument" title="Permalink to this definition">¶</a></dt>
<dd><p>The argument of the Bessel-type function.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.BesselBase.order">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">order</span></span><a class="headerlink" href="#sympy.functions.special.bessel.BesselBase.order" title="Permalink to this definition">¶</a></dt>
<dd><p>The order of the Bessel-type function.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.besselj">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">besselj</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L99-L259"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.besselj" title="Permalink to this definition">¶</a></dt>
<dd><p>Bessel function of the first kind.</p>
<p class="rubric">Explanation</p>
<p>The Bessel <span class="math notranslate nohighlight">\(J\)</span> function of order <span class="math notranslate nohighlight">\(\nu\)</span> is defined to be the function
satisfying Bessel’s differential equation</p>
<div class="math notranslate nohighlight">
\[z^2 \frac{\mathrm{d}^2 w}{\mathrm{d}z^2}
+ z \frac{\mathrm{d}w}{\mathrm{d}z} + (z^2 - \nu^2) w = 0,\]</div>
<p>with Laurent expansion</p>
<div class="math notranslate nohighlight">
\[J_\nu(z) = z^\nu \left(\frac{1}{\Gamma(\nu + 1) 2^\nu} + O(z^2) \right),\]</div>
<p>if <span class="math notranslate nohighlight">\(\nu\)</span> is not a negative integer. If <span class="math notranslate nohighlight">\(\nu=-n \in \mathbb{Z}_{&lt;0}\)</span>
<em>is</em> a negative integer, then the definition is</p>
<div class="math notranslate nohighlight">
\[J_{-n}(z) = (-1)^n J_n(z).\]</div>
<p class="rubric">Examples</p>
<p>Create a Bessel function object:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">besselj</span><span class="p">,</span> <span class="n">jn</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">besselj</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
</pre></div>
</div>
<p>Differentiate it:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">besselj(n - 1, z)/2 - besselj(n + 1, z)/2</span>
</pre></div>
</div>
<p>Rewrite in terms of spherical Bessel functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">jn</span><span class="p">)</span>
<span class="go">sqrt(2)*sqrt(z)*jn(n - 1/2, z)/sqrt(pi)</span>
</pre></div>
</div>
<p>Access the parameter and argument:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">order</span>
<span class="go">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">argument</span>
<span class="go">z</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besseli" title="sympy.functions.special.bessel.besseli"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besseli</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselk" title="sympy.functions.special.bessel.besselk"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselk</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r365"><span class="brackets"><a class="fn-backref" href="#id82">R365</a></span></dt>
<dd><p>Abramowitz, Milton; Stegun, Irene A., eds. (1965), “Chapter 9”,
Handbook of Mathematical Functions with Formulas, Graphs, and
Mathematical Tables</p>
</dd>
<dt class="label" id="r366"><span class="brackets"><a class="fn-backref" href="#id83">R366</a></span></dt>
<dd><p>Luke, Y. L. (1969), The Special Functions and Their
Approximations, Volume 1</p>
</dd>
<dt class="label" id="r367"><span class="brackets"><a class="fn-backref" href="#id84">R367</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Bessel_function">https://en.wikipedia.org/wiki/Bessel_function</a></p>
</dd>
<dt class="label" id="r368"><span class="brackets"><a class="fn-backref" href="#id85">R368</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Bessel-TypeFunctions/BesselJ/">http://functions.wolfram.com/Bessel-TypeFunctions/BesselJ/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.bessely">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">bessely</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L262-L391"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.bessely" title="Permalink to this definition">¶</a></dt>
<dd><p>Bessel function of the second kind.</p>
<p class="rubric">Explanation</p>
<p>The Bessel <span class="math notranslate nohighlight">\(Y\)</span> function of order <span class="math notranslate nohighlight">\(\nu\)</span> is defined as</p>
<div class="math notranslate nohighlight">
\[Y_\nu(z) = \lim_{\mu \to \nu} \frac{J_\mu(z) \cos(\pi \mu)
                                    - J_{-\mu}(z)}{\sin(\pi \mu)},\]</div>
<p>where <span class="math notranslate nohighlight">\(J_\mu(z)\)</span> is the Bessel function of the first kind.</p>
<p>It is a solution to Bessel’s equation, and linearly independent from
<span class="math notranslate nohighlight">\(J_\nu\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">bessely</span><span class="p">,</span> <span class="n">yn</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span> <span class="o">=</span> <span class="n">bessely</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">bessely(n - 1, z)/2 - bessely(n + 1, z)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">yn</span><span class="p">)</span>
<span class="go">sqrt(2)*sqrt(z)*yn(n - 1/2, z)/sqrt(pi)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besseli" title="sympy.functions.special.bessel.besseli"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besseli</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselk" title="sympy.functions.special.bessel.besselk"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselk</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r369"><span class="brackets"><a class="fn-backref" href="#id86">R369</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Bessel-TypeFunctions/BesselY/">http://functions.wolfram.com/Bessel-TypeFunctions/BesselY/</a></p>
</dd>
</dl>
</dd></dl>

<span class="target" id="besseli"></span><dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.besseli">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">besseli</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L394-L489"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.besseli" title="Permalink to this definition">¶</a></dt>
<dd><p>Modified Bessel function of the first kind.</p>
<p class="rubric">Explanation</p>
<p>The Bessel <span class="math notranslate nohighlight">\(I\)</span> function is a solution to the modified Bessel equation</p>
<div class="math notranslate nohighlight">
\[z^2 \frac{\mathrm{d}^2 w}{\mathrm{d}z^2}
+ z \frac{\mathrm{d}w}{\mathrm{d}z} + (z^2 + \nu^2)^2 w = 0.\]</div>
<p>It can be defined as</p>
<div class="math notranslate nohighlight">
\[I_\nu(z) = i^{-\nu} J_\nu(iz),\]</div>
<p>where <span class="math notranslate nohighlight">\(J_\nu(z)\)</span> is the Bessel function of the first kind.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">besseli</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">besseli</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">besseli(n - 1, z)/2 + besseli(n + 1, z)/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselk" title="sympy.functions.special.bessel.besselk"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselk</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r370"><span class="brackets"><a class="fn-backref" href="#id87">R370</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/">http://functions.wolfram.com/Bessel-TypeFunctions/BesselI/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.besselk">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">besselk</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L492-L571"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.besselk" title="Permalink to this definition">¶</a></dt>
<dd><p>Modified Bessel function of the second kind.</p>
<p class="rubric">Explanation</p>
<p>The Bessel <span class="math notranslate nohighlight">\(K\)</span> function of order <span class="math notranslate nohighlight">\(\nu\)</span> is defined as</p>
<div class="math notranslate nohighlight">
\[K_\nu(z) = \lim_{\mu \to \nu} \frac{\pi}{2}
           \frac{I_{-\mu}(z) -I_\mu(z)}{\sin(\pi \mu)},\]</div>
<p>where <span class="math notranslate nohighlight">\(I_\mu(z)\)</span> is the modified Bessel function of the first kind.</p>
<p>It is a solution of the modified Bessel equation, and linearly independent
from <span class="math notranslate nohighlight">\(Y_\nu\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">besselk</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">besselk</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">-besselk(n - 1, z)/2 - besselk(n + 1, z)/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besseli" title="sympy.functions.special.bessel.besseli"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besseli</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r371"><span class="brackets"><a class="fn-backref" href="#id88">R371</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Bessel-TypeFunctions/BesselK/">http://functions.wolfram.com/Bessel-TypeFunctions/BesselK/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.hankel1">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">hankel1</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L574-L617"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.hankel1" title="Permalink to this definition">¶</a></dt>
<dd><p>Hankel function of the first kind.</p>
<p class="rubric">Explanation</p>
<p>This function is defined as</p>
<div class="math notranslate nohighlight">
\[H_\nu^{(1)} = J_\nu(z) + iY_\nu(z),\]</div>
<p>where <span class="math notranslate nohighlight">\(J_\nu(z)\)</span> is the Bessel function of the first kind, and
<span class="math notranslate nohighlight">\(Y_\nu(z)\)</span> is the Bessel function of the second kind.</p>
<p>It is a solution to Bessel’s equation.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hankel1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hankel1</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">hankel1(n - 1, z)/2 - hankel1(n + 1, z)/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.hankel2" title="sympy.functions.special.bessel.hankel2"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel2</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r372"><span class="brackets"><a class="fn-backref" href="#id89">R372</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Bessel-TypeFunctions/HankelH1/">http://functions.wolfram.com/Bessel-TypeFunctions/HankelH1/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.hankel2">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">hankel2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L620-L664"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.hankel2" title="Permalink to this definition">¶</a></dt>
<dd><p>Hankel function of the second kind.</p>
<p class="rubric">Explanation</p>
<p>This function is defined as</p>
<div class="math notranslate nohighlight">
\[H_\nu^{(2)} = J_\nu(z) - iY_\nu(z),\]</div>
<p>where <span class="math notranslate nohighlight">\(J_\nu(z)\)</span> is the Bessel function of the first kind, and
<span class="math notranslate nohighlight">\(Y_\nu(z)\)</span> is the Bessel function of the second kind.</p>
<p>It is a solution to Bessel’s equation, and linearly independent from
<span class="math notranslate nohighlight">\(H_\nu^{(1)}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hankel2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hankel2</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">hankel2(n - 1, z)/2 - hankel2(n + 1, z)/2</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.hankel1" title="sympy.functions.special.bessel.hankel1"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hankel1</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r373"><span class="brackets"><a class="fn-backref" href="#id90">R373</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Bessel-TypeFunctions/HankelH2/">http://functions.wolfram.com/Bessel-TypeFunctions/HankelH2/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.jn">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">jn</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L712-L797"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.jn" title="Permalink to this definition">¶</a></dt>
<dd><p>Spherical Bessel function of the first kind.</p>
<p class="rubric">Explanation</p>
<p>This function is a solution to the spherical Bessel equation</p>
<div class="math notranslate nohighlight">
\[z^2 \frac{\mathrm{d}^2 w}{\mathrm{d}z^2}
  + 2z \frac{\mathrm{d}w}{\mathrm{d}z} + (z^2 - \nu(\nu + 1)) w = 0.\]</div>
<p>It can be defined as</p>
<div class="math notranslate nohighlight">
\[j_\nu(z) = \sqrt{\frac{\pi}{2z}} J_{\nu + \frac{1}{2}}(z),\]</div>
<p>where <span class="math notranslate nohighlight">\(J_\nu(z)\)</span> is the Bessel function of the first kind.</p>
<p>The spherical Bessel functions of integral order are
calculated using the formula:</p>
<div class="math notranslate nohighlight">
\[j_n(z) = f_n(z) \sin{z} + (-1)^{n+1} f_{-n-1}(z) \cos{z},\]</div>
<p>where the coefficients <span class="math notranslate nohighlight">\(f_n(z)\)</span> are available as
<a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.spherical_bessel_fn" title="sympy.polys.orthopolys.spherical_bessel_fn"><code class="xref py py-func docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.spherical_bessel_fn()</span></code></a>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">jn</span><span class="p">,</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">expand_func</span><span class="p">,</span> <span class="n">besselj</span><span class="p">,</span> <span class="n">bessely</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;z&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">nu</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;nu&quot;</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">expand_func</span><span class="p">(</span><span class="n">jn</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">)))</span>
<span class="go">sin(z)/z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">jn</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">z</span><span class="p">))</span> <span class="o">==</span> <span class="n">sin</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">/</span><span class="n">z</span><span class="o">**</span><span class="mi">2</span> <span class="o">-</span> <span class="n">cos</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">/</span><span class="n">z</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">jn</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">z</span><span class="p">))</span>
<span class="go">(-6/z**2 + 15/z**4)*sin(z) + (1/z - 15/z**3)*cos(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">jn</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">besselj</span><span class="p">)</span>
<span class="go">sqrt(2)*sqrt(pi)*sqrt(1/z)*besselj(nu + 1/2, z)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">jn</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">bessely</span><span class="p">)</span>
<span class="go">(-1)**nu*sqrt(2)*sqrt(pi)*sqrt(1/z)*bessely(-nu - 1/2, z)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">jn</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mf">5.2</span><span class="o">+</span><span class="mf">0.3</span><span class="n">j</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<span class="go">0.099419756723640344491 - 0.054525080242173562897*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselk" title="sympy.functions.special.bessel.besselk"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselk</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.yn" title="sympy.functions.special.bessel.yn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">yn</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r374"><span class="brackets"><a class="fn-backref" href="#id91">R374</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/10.47">http://dlmf.nist.gov/10.47</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.yn">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">yn</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">nu</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L800-L863"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.yn" title="Permalink to this definition">¶</a></dt>
<dd><p>Spherical Bessel function of the second kind.</p>
<p class="rubric">Explanation</p>
<p>This function is another solution to the spherical Bessel equation, and
linearly independent from <span class="math notranslate nohighlight">\(j_n\)</span>. It can be defined as</p>
<div class="math notranslate nohighlight">
\[y_\nu(z) = \sqrt{\frac{\pi}{2z}} Y_{\nu + \frac{1}{2}}(z),\]</div>
<p>where <span class="math notranslate nohighlight">\(Y_\nu(z)\)</span> is the Bessel function of the second kind.</p>
<p>For integral orders <span class="math notranslate nohighlight">\(n\)</span>, <span class="math notranslate nohighlight">\(y_n\)</span> is calculated using the formula:</p>
<div class="math notranslate nohighlight">
\[y_n(z) = (-1)^{n+1} j_{-n-1}(z)\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">yn</span><span class="p">,</span> <span class="n">sin</span><span class="p">,</span> <span class="n">cos</span><span class="p">,</span> <span class="n">expand_func</span><span class="p">,</span> <span class="n">besselj</span><span class="p">,</span> <span class="n">bessely</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">z</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;z&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">nu</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;nu&quot;</span><span class="p">,</span> <span class="n">integer</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">expand_func</span><span class="p">(</span><span class="n">yn</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">)))</span>
<span class="go">-cos(z)/z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">yn</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">z</span><span class="p">))</span> <span class="o">==</span> <span class="o">-</span><span class="n">cos</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">/</span><span class="n">z</span><span class="o">**</span><span class="mi">2</span><span class="o">-</span><span class="n">sin</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">/</span><span class="n">z</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">yn</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">besselj</span><span class="p">)</span>
<span class="go">(-1)**(nu + 1)*sqrt(2)*sqrt(pi)*sqrt(1/z)*besselj(-nu - 1/2, z)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">yn</span><span class="p">(</span><span class="n">nu</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">bessely</span><span class="p">)</span>
<span class="go">sqrt(2)*sqrt(pi)*sqrt(1/z)*bessely(nu + 1/2, z)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">yn</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mf">5.2</span><span class="o">+</span><span class="mf">0.3</span><span class="n">j</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">20</span><span class="p">)</span>
<span class="go">0.18525034196069722536 + 0.014895573969924817587*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselk" title="sympy.functions.special.bessel.besselk"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselk</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.jn" title="sympy.functions.special.bessel.jn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jn</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r375"><span class="brackets"><a class="fn-backref" href="#id92">R375</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/10.47">http://dlmf.nist.gov/10.47</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.jn_zeros">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">jn_zeros</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">method</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'sympy'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dps</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">15</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L1035-L1117"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.jn_zeros" title="Permalink to this definition">¶</a></dt>
<dd><p>Zeros of the spherical Bessel function of the first kind.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : integer</p>
<blockquote>
<div><p>order of Bessel function</p>
</div></blockquote>
<p><strong>k</strong> : integer</p>
<blockquote>
<div><p>number of zeros to return</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This returns an array of zeros of <span class="math notranslate nohighlight">\(jn\)</span> up to the <span class="math notranslate nohighlight">\(k\)</span>-th zero.</p>
<ul class="simple">
<li><p>method = “sympy”: uses <a class="reference external" href="http://mpmath.org/doc/current/functions/bessel.html#mpmath.besseljzero">mpmath.besseljzero</a></p></li>
<li><p>method = “scipy”: uses the
<a class="reference external" href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.special.jn_zeros.html">SciPy’s sph_jn</a>
and
<a class="reference external" href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.newton.html">newton</a>
to find all
roots, which is faster than computing the zeros using a general
numerical solver, but it requires SciPy and only works with low
precision floating point numbers. (The function used with
method=”sympy” is a recent addition to mpmath; before that a general
solver was used.)</p></li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">jn_zeros</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">jn_zeros</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="n">dps</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span>
<span class="go">[5.7635, 9.095, 12.323, 15.515]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bessel.jn" title="sympy.functions.special.bessel.jn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jn</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.yn" title="sympy.functions.special.bessel.yn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">yn</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselj" title="sympy.functions.special.bessel.besselj"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselj</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.besselk" title="sympy.functions.special.bessel.besselk"><code class="xref py py-obj docutils literal notranslate"><span class="pre">besselk</span></code></a>, <a class="reference internal" href="#sympy.functions.special.bessel.bessely" title="sympy.functions.special.bessel.bessely"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bessely</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.marcumq">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">marcumq</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L1821-L1927"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.marcumq" title="Permalink to this definition">¶</a></dt>
<dd><p>The Marcum Q-function.</p>
<p class="rubric">Explanation</p>
<p>The Marcum Q-function is defined by the meromorphic continuation of</p>
<div class="math notranslate nohighlight">
\[Q_m(a, b) = a^{- m + 1} \int_{b}^{\infty} x^{m} e^{- \frac{a^{2}}{2} - \frac{x^{2}}{2}} I_{m - 1}\left(a x\right)\, dx\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">marcumq</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">m</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">marcumq</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
<span class="go">marcumq(m, a, b)</span>
</pre></div>
</div>
<p>Special values:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">marcumq</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
<span class="go">uppergamma(m, b**2/2)/gamma(m)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">marcumq</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">marcumq</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">1 - exp(-a**2/2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">marcumq</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span>
<span class="go">1/2 + exp(-a**2)*besseli(0, a**2)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">marcumq</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span>
<span class="go">1/2 + exp(-a**2)*besseli(0, a**2)/2 + exp(-a**2)*besseli(1, a**2)</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(a\)</span> and <span class="math notranslate nohighlight">\(b\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">marcumq</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">),</span> <span class="n">a</span><span class="p">)</span>
<span class="go">a*(-marcumq(m, a, b) + marcumq(m + 1, a, b))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">marcumq</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">),</span> <span class="n">b</span><span class="p">)</span>
<span class="go">-a**(1 - m)*b**m*exp(-a**2/2 - b**2/2)*besseli(m - 1, a*b)</span>
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r376"><span class="brackets"><a class="fn-backref" href="#id93">R376</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Marcum_Q-function">https://en.wikipedia.org/wiki/Marcum_Q-function</a></p>
</dd>
<dt class="label" id="r377"><span class="brackets"><a class="fn-backref" href="#id94">R377</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/MarcumQ-Function.html">http://mathworld.wolfram.com/MarcumQ-Function.html</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="airy-functions">
<h2>Airy Functions<a class="headerlink" href="#airy-functions" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.AiryBase">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">AiryBase</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L1120-L1144"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.AiryBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for Airy functions.</p>
<p>This class is meant to reduce code duplication.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.airyai">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">airyai</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L1147-L1316"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.airyai" title="Permalink to this definition">¶</a></dt>
<dd><p>The Airy function <span class="math notranslate nohighlight">\(\operatorname{Ai}\)</span> of the first kind.</p>
<p class="rubric">Explanation</p>
<p>The Airy function <span class="math notranslate nohighlight">\(\operatorname{Ai}(z)\)</span> is defined to be the function
satisfying Airy’s differential equation</p>
<div class="math notranslate nohighlight">
\[\frac{\mathrm{d}^2 w(z)}{\mathrm{d}z^2} - z w(z) = 0.\]</div>
<p>Equivalently, for real <span class="math notranslate nohighlight">\(z\)</span></p>
<div class="math notranslate nohighlight">
\[\operatorname{Ai}(z) := \frac{1}{\pi}
\int_0^\infty \cos\left(\frac{t^3}{3} + z t\right) \mathrm{d}t.\]</div>
<p class="rubric">Examples</p>
<p>Create an Airy function object:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">airyai</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airyai</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">airyai(z)</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airyai</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">3**(1/3)/(3*gamma(2/3))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airyai</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airyai</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>The Airy function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">airyai</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">airyai(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airyai</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">airyaiprime(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airyai</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">z*airyai(z)</span>
</pre></div>
</div>
<p>Series expansion is also supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">series</span><span class="p">(</span><span class="n">airyai</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">3**(5/6)*gamma(1/3)/(6*pi) - 3**(1/6)*z*gamma(2/3)/(2*pi) + O(z**3)</span>
</pre></div>
</div>
<p>We can numerically evaluate the Airy function to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airyai</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span>
<span class="go">0.22740742820168557599192443603787379946077222541710</span>
</pre></div>
</div>
<p>Rewrite <span class="math notranslate nohighlight">\(\operatorname{Ai}(z)\)</span> in terms of hypergeometric functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hyper</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airyai</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">hyper</span><span class="p">)</span>
<span class="go">-3**(2/3)*z*hyper((), (4/3,), z**3/9)/(3*gamma(1/3)) + 3**(1/3)*hyper((), (2/3,), z**3/9)/(3*gamma(2/3))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airybi" title="sympy.functions.special.bessel.airybi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airybi</span></code></a></dt><dd><p>Airy function of the second kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airyaiprime" title="sympy.functions.special.bessel.airyaiprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airyaiprime</span></code></a></dt><dd><p>Derivative of the Airy function of the first kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airybiprime" title="sympy.functions.special.bessel.airybiprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airybiprime</span></code></a></dt><dd><p>Derivative of the Airy function of the second kind.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r378"><span class="brackets"><a class="fn-backref" href="#id95">R378</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Airy_function">https://en.wikipedia.org/wiki/Airy_function</a></p>
</dd>
<dt class="label" id="r379"><span class="brackets"><a class="fn-backref" href="#id96">R379</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/9">http://dlmf.nist.gov/9</a></p>
</dd>
<dt class="label" id="r380"><span class="brackets"><a class="fn-backref" href="#id97">R380</a></span></dt>
<dd><p><a class="reference external" href="http://www.encyclopediaofmath.org/index.php/Airy_functions">http://www.encyclopediaofmath.org/index.php/Airy_functions</a></p>
</dd>
<dt class="label" id="r381"><span class="brackets"><a class="fn-backref" href="#id98">R381</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/AiryFunctions.html">http://mathworld.wolfram.com/AiryFunctions.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.airybi">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">airybi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L1319-L1493"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.airybi" title="Permalink to this definition">¶</a></dt>
<dd><p>The Airy function <span class="math notranslate nohighlight">\(\operatorname{Bi}\)</span> of the second kind.</p>
<p class="rubric">Explanation</p>
<p>The Airy function <span class="math notranslate nohighlight">\(\operatorname{Bi}(z)\)</span> is defined to be the function
satisfying Airy’s differential equation</p>
<div class="math notranslate nohighlight">
\[\frac{\mathrm{d}^2 w(z)}{\mathrm{d}z^2} - z w(z) = 0.\]</div>
<p>Equivalently, for real <span class="math notranslate nohighlight">\(z\)</span></p>
<div class="math notranslate nohighlight">
\[\operatorname{Bi}(z) := \frac{1}{\pi}
         \int_0^\infty
           \exp\left(-\frac{t^3}{3} + z t\right)
           + \sin\left(\frac{t^3}{3} + z t\right) \mathrm{d}t.\]</div>
<p class="rubric">Examples</p>
<p>Create an Airy function object:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">airybi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airybi</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">airybi(z)</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airybi</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">3**(5/6)/(3*gamma(2/3))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airybi</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airybi</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>The Airy function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">airybi</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">airybi(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airybi</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">airybiprime(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airybi</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">z*airybi(z)</span>
</pre></div>
</div>
<p>Series expansion is also supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">series</span><span class="p">(</span><span class="n">airybi</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">3**(1/3)*gamma(1/3)/(2*pi) + 3**(2/3)*z*gamma(2/3)/(2*pi) + O(z**3)</span>
</pre></div>
</div>
<p>We can numerically evaluate the Airy function to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airybi</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span>
<span class="go">-0.41230258795639848808323405461146104203453483447240</span>
</pre></div>
</div>
<p>Rewrite <span class="math notranslate nohighlight">\(\operatorname{Bi}(z)\)</span> in terms of hypergeometric functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hyper</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airybi</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">hyper</span><span class="p">)</span>
<span class="go">3**(1/6)*z*hyper((), (4/3,), z**3/9)/gamma(1/3) + 3**(5/6)*hyper((), (2/3,), z**3/9)/(3*gamma(2/3))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airyai" title="sympy.functions.special.bessel.airyai"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airyai</span></code></a></dt><dd><p>Airy function of the first kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airyaiprime" title="sympy.functions.special.bessel.airyaiprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airyaiprime</span></code></a></dt><dd><p>Derivative of the Airy function of the first kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airybiprime" title="sympy.functions.special.bessel.airybiprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airybiprime</span></code></a></dt><dd><p>Derivative of the Airy function of the second kind.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r382"><span class="brackets"><a class="fn-backref" href="#id99">R382</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Airy_function">https://en.wikipedia.org/wiki/Airy_function</a></p>
</dd>
<dt class="label" id="r383"><span class="brackets"><a class="fn-backref" href="#id100">R383</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/9">http://dlmf.nist.gov/9</a></p>
</dd>
<dt class="label" id="r384"><span class="brackets"><a class="fn-backref" href="#id101">R384</a></span></dt>
<dd><p><a class="reference external" href="http://www.encyclopediaofmath.org/index.php/Airy_functions">http://www.encyclopediaofmath.org/index.php/Airy_functions</a></p>
</dd>
<dt class="label" id="r385"><span class="brackets"><a class="fn-backref" href="#id102">R385</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/AiryFunctions.html">http://mathworld.wolfram.com/AiryFunctions.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.airyaiprime">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">airyaiprime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L1496-L1652"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.airyaiprime" title="Permalink to this definition">¶</a></dt>
<dd><p>The derivative <span class="math notranslate nohighlight">\(\operatorname{Ai}^\prime\)</span> of the Airy function of the first
kind.</p>
<p class="rubric">Explanation</p>
<p>The Airy function <span class="math notranslate nohighlight">\(\operatorname{Ai}^\prime(z)\)</span> is defined to be the
function</p>
<div class="math notranslate nohighlight">
\[\operatorname{Ai}^\prime(z) := \frac{\mathrm{d} \operatorname{Ai}(z)}{\mathrm{d} z}.\]</div>
<p class="rubric">Examples</p>
<p>Create an Airy function object:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">airyaiprime</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airyaiprime</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">airyaiprime(z)</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airyaiprime</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">-3**(2/3)/(3*gamma(1/3))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airyaiprime</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>The Airy function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">airyaiprime</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">airyaiprime(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airyaiprime</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">z*airyai(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airyaiprime</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">z*airyaiprime(z) + airyai(z)</span>
</pre></div>
</div>
<p>Series expansion is also supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">series</span><span class="p">(</span><span class="n">airyaiprime</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">-3**(2/3)/(3*gamma(1/3)) + 3**(1/3)*z**2/(6*gamma(2/3)) + O(z**3)</span>
</pre></div>
</div>
<p>We can numerically evaluate the Airy function to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airyaiprime</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span>
<span class="go">0.61825902074169104140626429133247528291577794512415</span>
</pre></div>
</div>
<p>Rewrite <span class="math notranslate nohighlight">\(\operatorname{Ai}^\prime(z)\)</span> in terms of hypergeometric functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hyper</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airyaiprime</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">hyper</span><span class="p">)</span>
<span class="go">3**(1/3)*z**2*hyper((), (5/3,), z**3/9)/(6*gamma(2/3)) - 3**(2/3)*hyper((), (1/3,), z**3/9)/(3*gamma(1/3))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airyai" title="sympy.functions.special.bessel.airyai"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airyai</span></code></a></dt><dd><p>Airy function of the first kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airybi" title="sympy.functions.special.bessel.airybi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airybi</span></code></a></dt><dd><p>Airy function of the second kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airybiprime" title="sympy.functions.special.bessel.airybiprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airybiprime</span></code></a></dt><dd><p>Derivative of the Airy function of the second kind.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r386"><span class="brackets"><a class="fn-backref" href="#id103">R386</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Airy_function">https://en.wikipedia.org/wiki/Airy_function</a></p>
</dd>
<dt class="label" id="r387"><span class="brackets"><a class="fn-backref" href="#id104">R387</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/9">http://dlmf.nist.gov/9</a></p>
</dd>
<dt class="label" id="r388"><span class="brackets"><a class="fn-backref" href="#id105">R388</a></span></dt>
<dd><p><a class="reference external" href="http://www.encyclopediaofmath.org/index.php/Airy_functions">http://www.encyclopediaofmath.org/index.php/Airy_functions</a></p>
</dd>
<dt class="label" id="r389"><span class="brackets"><a class="fn-backref" href="#id106">R389</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/AiryFunctions.html">http://mathworld.wolfram.com/AiryFunctions.html</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.bessel.airybiprime">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bessel.</span></span><span class="sig-name descname"><span class="pre">airybiprime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">arg</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bessel.py#L1655-L1818"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bessel.airybiprime" title="Permalink to this definition">¶</a></dt>
<dd><p>The derivative <span class="math notranslate nohighlight">\(\operatorname{Bi}^\prime\)</span> of the Airy function of the first
kind.</p>
<p class="rubric">Explanation</p>
<p>The Airy function <span class="math notranslate nohighlight">\(\operatorname{Bi}^\prime(z)\)</span> is defined to be the
function</p>
<div class="math notranslate nohighlight">
\[\operatorname{Bi}^\prime(z) := \frac{\mathrm{d} \operatorname{Bi}(z)}{\mathrm{d} z}.\]</div>
<p class="rubric">Examples</p>
<p>Create an Airy function object:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">airybiprime</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airybiprime</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">airybiprime(z)</span>
</pre></div>
</div>
<p>Several special values are known:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airybiprime</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">3**(1/6)/gamma(1/3)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airybiprime</span><span class="p">(</span><span class="n">oo</span><span class="p">)</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airybiprime</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>The Airy function obeys the mirror symmetry:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">airybiprime</span><span class="p">(</span><span class="n">z</span><span class="p">))</span>
<span class="go">airybiprime(conjugate(z))</span>
</pre></div>
</div>
<p>Differentiation with respect to <span class="math notranslate nohighlight">\(z\)</span> is supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airybiprime</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">z*airybi(z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">airybiprime</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">z*airybiprime(z) + airybi(z)</span>
</pre></div>
</div>
<p>Series expansion is also supported:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">series</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">series</span><span class="p">(</span><span class="n">airybiprime</span><span class="p">(</span><span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">3**(1/6)/gamma(1/3) + 3**(5/6)*z**2/(6*gamma(2/3)) + O(z**3)</span>
</pre></div>
</div>
<p>We can numerically evaluate the Airy function to arbitrary precision
on the whole complex plane:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">airybiprime</span><span class="p">(</span><span class="o">-</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">evalf</span><span class="p">(</span><span class="mi">50</span><span class="p">)</span>
<span class="go">0.27879516692116952268509756941098324140300059345163</span>
</pre></div>
</div>
<p>Rewrite <span class="math notranslate nohighlight">\(\operatorname{Bi}^\prime(z)\)</span> in terms of hypergeometric functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hyper</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">airybiprime</span><span class="p">(</span><span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">hyper</span><span class="p">)</span>
<span class="go">3**(5/6)*z**2*hyper((), (5/3,), z**3/9)/(6*gamma(2/3)) + 3**(1/6)*hyper((), (1/3,), z**3/9)/gamma(1/3)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airyai" title="sympy.functions.special.bessel.airyai"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airyai</span></code></a></dt><dd><p>Airy function of the first kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airybi" title="sympy.functions.special.bessel.airybi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airybi</span></code></a></dt><dd><p>Airy function of the second kind.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.bessel.airyaiprime" title="sympy.functions.special.bessel.airyaiprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">airyaiprime</span></code></a></dt><dd><p>Derivative of the Airy function of the first kind.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r390"><span class="brackets"><a class="fn-backref" href="#id107">R390</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Airy_function">https://en.wikipedia.org/wiki/Airy_function</a></p>
</dd>
<dt class="label" id="r391"><span class="brackets"><a class="fn-backref" href="#id108">R391</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/9">http://dlmf.nist.gov/9</a></p>
</dd>
<dt class="label" id="r392"><span class="brackets"><a class="fn-backref" href="#id109">R392</a></span></dt>
<dd><p><a class="reference external" href="http://www.encyclopediaofmath.org/index.php/Airy_functions">http://www.encyclopediaofmath.org/index.php/Airy_functions</a></p>
</dd>
<dt class="label" id="r393"><span class="brackets"><a class="fn-backref" href="#id110">R393</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/AiryFunctions.html">http://mathworld.wolfram.com/AiryFunctions.html</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="b-splines">
<h2>B-Splines<a class="headerlink" href="#b-splines" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.bsplines.bspline_basis">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bsplines.</span></span><span class="sig-name descname"><span class="pre">bspline_basis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">d</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">knots</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bsplines.py#L83-L201"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bsplines.bspline_basis" title="Permalink to this definition">¶</a></dt>
<dd><p>The <span class="math notranslate nohighlight">\(n\)</span>-th B-spline at <span class="math notranslate nohighlight">\(x\)</span> of degree <span class="math notranslate nohighlight">\(d\)</span> with knots.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>d</strong> : integer</p>
<blockquote>
<div><p>degree of bspline</p>
</div></blockquote>
<p><strong>knots</strong> : list of integer values</p>
<blockquote>
<div><p>list of knots points of bspline</p>
</div></blockquote>
<p><strong>n</strong> : integer</p>
<blockquote>
<div><p><span class="math notranslate nohighlight">\(n\)</span>-th B-spline</p>
</div></blockquote>
<p><strong>x</strong> : symbol</p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>B-Splines are piecewise polynomials of degree <span class="math notranslate nohighlight">\(d\)</span>. They are defined on a
set of knots, which is a sequence of integers or floats.</p>
<p class="rubric">Examples</p>
<p>The 0th degree splines have a value of 1 on a single interval:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">bspline_basis</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="mi">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">knots</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">bspline_basis</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">knots</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">Piecewise((1, (x &gt;= 0) &amp; (x &lt;= 1)), (0, True))</span>
</pre></div>
</div>
<p>For a given <code class="docutils literal notranslate"><span class="pre">(d,</span> <span class="pre">knots)</span></code> there are <code class="docutils literal notranslate"><span class="pre">len(knots)-d-1</span></code> B-splines
defined, that are indexed by <code class="docutils literal notranslate"><span class="pre">n</span></code> (starting at 0).</p>
<p>Here is an example of a cubic B-spline:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">bspline_basis</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="nb">tuple</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">)),</span> <span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">Piecewise((x**3/6, (x &gt;= 0) &amp; (x &lt;= 1)),</span>
<span class="go">          (-x**3/2 + 2*x**2 - 2*x + 2/3,</span>
<span class="go">          (x &gt;= 1) &amp; (x &lt;= 2)),</span>
<span class="go">          (x**3/2 - 4*x**2 + 10*x - 22/3,</span>
<span class="go">          (x &gt;= 2) &amp; (x &lt;= 3)),</span>
<span class="go">          (-x**3/6 + 2*x**2 - 8*x + 32/3,</span>
<span class="go">          (x &gt;= 3) &amp; (x &lt;= 4)),</span>
<span class="go">          (0, True))</span>
</pre></div>
</div>
<p>By repeating knot points, you can introduce discontinuities in the
B-splines and their derivatives:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="mi">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">knots</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">bspline_basis</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">knots</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">Piecewise((1 - x/2, (x &gt;= 0) &amp; (x &lt;= 2)), (0, True))</span>
</pre></div>
</div>
<p>It is quite time consuming to construct and evaluate B-splines. If
you need to evaluate a B-spline many times, it is best to lambdify them
first:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">lambdify</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="mi">3</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">knots</span> <span class="o">=</span> <span class="nb">tuple</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="mi">10</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b0</span> <span class="o">=</span> <span class="n">bspline_basis</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">knots</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">f</span> <span class="o">=</span> <span class="n">lambdify</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">b0</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">y</span> <span class="o">=</span> <span class="n">f</span><span class="p">(</span><span class="mf">0.5</span><span class="p">)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bsplines.bspline_basis_set" title="sympy.functions.special.bsplines.bspline_basis_set"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bspline_basis_set</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r394"><span class="brackets"><a class="fn-backref" href="#id111">R394</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/B-spline">https://en.wikipedia.org/wiki/B-spline</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.bsplines.bspline_basis_set">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bsplines.</span></span><span class="sig-name descname"><span class="pre">bspline_basis_set</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">d</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">knots</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bsplines.py#L204-L253"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bsplines.bspline_basis_set" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the <code class="docutils literal notranslate"><span class="pre">len(knots)-d-1</span></code> B-splines at <em>x</em> of degree <em>d</em>
with <em>knots</em>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>d</strong> : integer</p>
<blockquote>
<div><p>degree of bspline</p>
</div></blockquote>
<p><strong>knots</strong> : list of integers</p>
<blockquote>
<div><p>list of knots points of bspline</p>
</div></blockquote>
<p><strong>x</strong> : symbol</p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This function returns a list of piecewise polynomials that are the
<code class="docutils literal notranslate"><span class="pre">len(knots)-d-1</span></code> B-splines of degree <em>d</em> for the given knots.
This function calls <code class="docutils literal notranslate"><span class="pre">bspline_basis(d,</span> <span class="pre">knots,</span> <span class="pre">n,</span> <span class="pre">x)</span></code> for different
values of <em>n</em>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">bspline_basis_set</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span> <span class="o">=</span> <span class="mi">2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">knots</span> <span class="o">=</span> <span class="nb">range</span><span class="p">(</span><span class="mi">5</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">splines</span> <span class="o">=</span> <span class="n">bspline_basis_set</span><span class="p">(</span><span class="n">d</span><span class="p">,</span> <span class="n">knots</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">splines</span>
<span class="go">[Piecewise((x**2/2, (x &gt;= 0) &amp; (x &lt;= 1)),</span>
<span class="go">           (-x**2 + 3*x - 3/2, (x &gt;= 1) &amp; (x &lt;= 2)),</span>
<span class="go">           (x**2/2 - 3*x + 9/2, (x &gt;= 2) &amp; (x &lt;= 3)),</span>
<span class="go">           (0, True)),</span>
<span class="go">Piecewise((x**2/2 - x + 1/2, (x &gt;= 1) &amp; (x &lt;= 2)),</span>
<span class="go">          (-x**2 + 5*x - 11/2, (x &gt;= 2) &amp; (x &lt;= 3)),</span>
<span class="go">          (x**2/2 - 4*x + 8, (x &gt;= 3) &amp; (x &lt;= 4)),</span>
<span class="go">          (0, True))]</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bsplines.bspline_basis" title="sympy.functions.special.bsplines.bspline_basis"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bspline_basis</span></code></a></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.bsplines.interpolating_spline">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.bsplines.</span></span><span class="sig-name descname"><span class="pre">interpolating_spline</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">d</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">X</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">Y</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/bsplines.py#L256-L352"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.bsplines.interpolating_spline" title="Permalink to this definition">¶</a></dt>
<dd><p>Return spline of degree <em>d</em>, passing through the given <em>X</em>
and <em>Y</em> values.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>d</strong> : integer</p>
<blockquote>
<div><p>Degree of Bspline strictly greater than equal to one</p>
</div></blockquote>
<p><strong>x</strong> : symbol</p>
<p><strong>X</strong> : list of strictly increasing integer values</p>
<blockquote>
<div><p>list of X coordinates through which the spline passes</p>
</div></blockquote>
<p><strong>Y</strong> : list of strictly increasing integer values</p>
<blockquote>
<div><p>list of Y coordinates through which the spline passes</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>This function returns a piecewise function such that each part is
a polynomial of degree not greater than <em>d</em>. The value of <em>d</em>
must be 1 or greater and the values of <em>X</em> must be strictly
increasing.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">interpolating_spline</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">interpolating_spline</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">7</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">7</span><span class="p">])</span>
<span class="go">Piecewise((3*x, (x &gt;= 1) &amp; (x &lt;= 2)),</span>
<span class="go">        (7 - x/2, (x &gt;= 2) &amp; (x &lt;= 4)),</span>
<span class="go">        (2*x/3 + 7/3, (x &gt;= 4) &amp; (x &lt;= 7)))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">interpolating_spline</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">],</span> <span class="p">[</span><span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">])</span>
<span class="go">Piecewise((7*x**3/117 + 7*x**2/117 - 131*x/117 + 2, (x &gt;= -2) &amp; (x &lt;= 1)),</span>
<span class="go">        (10*x**3/117 - 2*x**2/117 - 122*x/117 + 77/39, (x &gt;= 1) &amp; (x &lt;= 4)))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.bsplines.bspline_basis_set" title="sympy.functions.special.bsplines.bspline_basis_set"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bspline_basis_set</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.specialpolys.interpolating_poly" title="sympy.polys.specialpolys.interpolating_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">interpolating_poly</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="module-sympy.functions.special.zeta_functions">
<span id="riemann-zeta-and-related-functions"></span><h2>Riemann Zeta and Related Functions<a class="headerlink" href="#module-sympy.functions.special.zeta_functions" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.zeta_functions.zeta">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.zeta_functions.</span></span><span class="sig-name descname"><span class="pre">zeta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a_</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/zeta_functions.py#L394-L567"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.zeta_functions.zeta" title="Permalink to this definition">¶</a></dt>
<dd><p>Hurwitz zeta function (or Riemann zeta function).</p>
<p class="rubric">Explanation</p>
<p>For <span class="math notranslate nohighlight">\(\operatorname{Re}(a) &gt; 0\)</span> and <span class="math notranslate nohighlight">\(\operatorname{Re}(s) &gt; 1\)</span>, this
function is defined as</p>
<div class="math notranslate nohighlight">
\[\zeta(s, a) = \sum_{n=0}^\infty \frac{1}{(n + a)^s},\]</div>
<p>where the standard choice of argument for <span class="math notranslate nohighlight">\(n + a\)</span> is used. For fixed
<span class="math notranslate nohighlight">\(a\)</span> with <span class="math notranslate nohighlight">\(\operatorname{Re}(a) &gt; 0\)</span> the Hurwitz zeta function admits a
meromorphic continuation to all of <span class="math notranslate nohighlight">\(\mathbb{C}\)</span>, it is an unbranched
function with a simple pole at <span class="math notranslate nohighlight">\(s = 1\)</span>.</p>
<p>Analytic continuation to other <span class="math notranslate nohighlight">\(a\)</span> is possible under some circumstances,
but this is not typically done.</p>
<p>The Hurwitz zeta function is a special case of the Lerch transcendent:</p>
<div class="math notranslate nohighlight">
\[\zeta(s, a) = \Phi(1, s, a).\]</div>
<p>This formula defines an analytic continuation for all possible values of
<span class="math notranslate nohighlight">\(s\)</span> and <span class="math notranslate nohighlight">\(a\)</span> (also <span class="math notranslate nohighlight">\(\operatorname{Re}(a) &lt; 0\)</span>), see the documentation of
<a class="reference internal" href="#sympy.functions.special.zeta_functions.lerchphi" title="sympy.functions.special.zeta_functions.lerchphi"><code class="xref py py-class docutils literal notranslate"><span class="pre">lerchphi</span></code></a> for a description of the branching behavior.</p>
<p>If no value is passed for <span class="math notranslate nohighlight">\(a\)</span>, by this function assumes a default value
of <span class="math notranslate nohighlight">\(a = 1\)</span>, yielding the Riemann zeta function.</p>
<p class="rubric">Examples</p>
<p>For <span class="math notranslate nohighlight">\(a = 1\)</span> the Hurwitz zeta function reduces to the famous Riemann
zeta function:</p>
<div class="math notranslate nohighlight">
\[\zeta(s, 1) = \zeta(s) = \sum_{n=1}^\infty \frac{1}{n^s}.\]</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">zeta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">zeta(s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
<span class="go">zeta(s)</span>
</pre></div>
</div>
<p>The Riemann zeta function can also be expressed using the Dirichlet eta
function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">dirichlet_eta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="n">s</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">dirichlet_eta</span><span class="p">)</span>
<span class="go">dirichlet_eta(s)/(1 - 2**(1 - s))</span>
</pre></div>
</div>
<p>The Riemann zeta function at positive even integer and negative odd integer
values is related to the Bernoulli numbers:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="mi">2</span><span class="p">)</span>
<span class="go">pi**2/6</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="mi">4</span><span class="p">)</span>
<span class="go">pi**4/90</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-1/12</span>
</pre></div>
</div>
<p>The specific formulae are:</p>
<div class="math notranslate nohighlight">
\[\zeta(2n) = (-1)^{n+1} \frac{B_{2n} (2\pi)^{2n}}{2(2n)!}\]</div>
<div class="math notranslate nohighlight">
\[\zeta(-n) = -\frac{B_{n+1}}{n+1}\]</div>
<p>At negative even integers the Riemann zeta function is zero:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="o">-</span><span class="mi">4</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<p>No closed-form expressions are known at positive odd integers, but
numerical evaluation is possible:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">.</span><span class="n">n</span><span class="p">()</span>
<span class="go">1.20205690315959</span>
</pre></div>
</div>
<p>The derivative of <span class="math notranslate nohighlight">\(\zeta(s, a)\)</span> with respect to <span class="math notranslate nohighlight">\(a\)</span> can be computed:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="go">-s*zeta(s + 1, a)</span>
</pre></div>
</div>
<p>However the derivative with respect to <span class="math notranslate nohighlight">\(s\)</span> has no useful closed form
expression:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">s</span><span class="p">)</span>
<span class="go">Derivative(zeta(s, a), s)</span>
</pre></div>
</div>
<p>The Hurwitz zeta function can be expressed in terms of the Lerch
transcendent, <a class="reference internal" href="#sympy.functions.special.zeta_functions.lerchphi" title="sympy.functions.special.zeta_functions.lerchphi"><code class="xref py py-class docutils literal notranslate"><span class="pre">lerchphi</span></code></a>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">lerchphi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">zeta</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">lerchphi</span><span class="p">)</span>
<span class="go">lerchphi(1, s, a)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.zeta_functions.dirichlet_eta" title="sympy.functions.special.zeta_functions.dirichlet_eta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dirichlet_eta</span></code></a>, <a class="reference internal" href="#sympy.functions.special.zeta_functions.lerchphi" title="sympy.functions.special.zeta_functions.lerchphi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lerchphi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.zeta_functions.polylog" title="sympy.functions.special.zeta_functions.polylog"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polylog</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r395"><span class="brackets"><a class="fn-backref" href="#id112">R395</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/25.11">http://dlmf.nist.gov/25.11</a></p>
</dd>
<dt class="label" id="r396"><span class="brackets"><a class="fn-backref" href="#id113">R396</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Hurwitz_zeta_function">https://en.wikipedia.org/wiki/Hurwitz_zeta_function</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.zeta_functions.dirichlet_eta">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.zeta_functions.</span></span><span class="sig-name descname"><span class="pre">dirichlet_eta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/zeta_functions.py#L570-L615"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.zeta_functions.dirichlet_eta" title="Permalink to this definition">¶</a></dt>
<dd><p>Dirichlet eta function.</p>
<p class="rubric">Explanation</p>
<p>For <span class="math notranslate nohighlight">\(\operatorname{Re}(s) &gt; 0\)</span>, this function is defined as</p>
<div class="math notranslate nohighlight">
\[\eta(s) = \sum_{n=1}^\infty \frac{(-1)^{n-1}}{n^s}.\]</div>
<p>It admits a unique analytic continuation to all of <span class="math notranslate nohighlight">\(\mathbb{C}\)</span>.
It is an entire, unbranched function.</p>
<p class="rubric">Examples</p>
<p>The Dirichlet eta function is closely related to the Riemann zeta function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">dirichlet_eta</span><span class="p">,</span> <span class="n">zeta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">dirichlet_eta</span><span class="p">(</span><span class="n">s</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">zeta</span><span class="p">)</span>
<span class="go">(1 - 2**(1 - s))*zeta(s)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.zeta_functions.zeta" title="sympy.functions.special.zeta_functions.zeta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zeta</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r397"><span class="brackets"><a class="fn-backref" href="#id114">R397</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Dirichlet_eta_function">https://en.wikipedia.org/wiki/Dirichlet_eta_function</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.zeta_functions.polylog">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.zeta_functions.</span></span><span class="sig-name descname"><span class="pre">polylog</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/zeta_functions.py#L210-L387"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.zeta_functions.polylog" title="Permalink to this definition">¶</a></dt>
<dd><p>Polylogarithm function.</p>
<p class="rubric">Explanation</p>
<p>For <span class="math notranslate nohighlight">\(|z| &lt; 1\)</span> and <span class="math notranslate nohighlight">\(s \in \mathbb{C}\)</span>, the polylogarithm is
defined by</p>
<div class="math notranslate nohighlight">
\[\operatorname{Li}_s(z) = \sum_{n=1}^\infty \frac{z^n}{n^s},\]</div>
<p>where the standard branch of the argument is used for <span class="math notranslate nohighlight">\(n\)</span>. It admits
an analytic continuation which is branched at <span class="math notranslate nohighlight">\(z=1\)</span> (notably not on the
sheet of initial definition), <span class="math notranslate nohighlight">\(z=0\)</span> and <span class="math notranslate nohighlight">\(z=\infty\)</span>.</p>
<p>The name polylogarithm comes from the fact that for <span class="math notranslate nohighlight">\(s=1\)</span>, the
polylogarithm is related to the ordinary logarithm (see examples), and that</p>
<div class="math notranslate nohighlight">
\[\operatorname{Li}_{s+1}(z) =
\int_0^z \frac{\operatorname{Li}_s(t)}{t} \mathrm{d}t.\]</div>
<p>The polylogarithm is a special case of the Lerch transcendent:</p>
<div class="math notranslate nohighlight">
\[\operatorname{Li}_{s}(z) = z \Phi(z, s, 1).\]</div>
<p class="rubric">Examples</p>
<p>For <span class="math notranslate nohighlight">\(z \in \{0, 1, -1\}\)</span>, the polylogarithm is automatically expressed
using other functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">polylog</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">s</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polylog</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polylog</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">zeta(s)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polylog</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">-dirichlet_eta(s)</span>
</pre></div>
</div>
<p>If <span class="math notranslate nohighlight">\(s\)</span> is a negative integer, <span class="math notranslate nohighlight">\(0\)</span> or <span class="math notranslate nohighlight">\(1\)</span>, the polylogarithm can be
expressed using elementary functions. This can be done using
<code class="docutils literal notranslate"><span class="pre">expand_func()</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">polylog</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">z</span><span class="p">))</span>
<span class="go">-log(1 - z)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">polylog</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">))</span>
<span class="go">z/(1 - z)</span>
</pre></div>
</div>
<p>The derivative with respect to <span class="math notranslate nohighlight">\(z\)</span> can be computed in closed form:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">polylog</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">polylog(s - 1, z)/z</span>
</pre></div>
</div>
<p>The polylogarithm can be expressed in terms of the lerch transcendent:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">lerchphi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">polylog</span><span class="p">(</span><span class="n">s</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">rewrite</span><span class="p">(</span><span class="n">lerchphi</span><span class="p">)</span>
<span class="go">z*lerchphi(z, s, 1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.zeta_functions.zeta" title="sympy.functions.special.zeta_functions.zeta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zeta</span></code></a>, <a class="reference internal" href="#sympy.functions.special.zeta_functions.lerchphi" title="sympy.functions.special.zeta_functions.lerchphi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lerchphi</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.zeta_functions.lerchphi">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.zeta_functions.</span></span><span class="sig-name descname"><span class="pre">lerchphi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/zeta_functions.py#L16-L203"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.zeta_functions.lerchphi" title="Permalink to this definition">¶</a></dt>
<dd><p>Lerch transcendent (Lerch phi function).</p>
<p class="rubric">Explanation</p>
<p>For <span class="math notranslate nohighlight">\(\operatorname{Re}(a) &gt; 0\)</span>, <span class="math notranslate nohighlight">\(|z| &lt; 1\)</span> and <span class="math notranslate nohighlight">\(s \in \mathbb{C}\)</span>, the
Lerch transcendent is defined as</p>
<div class="math notranslate nohighlight">
\[\Phi(z, s, a) = \sum_{n=0}^\infty \frac{z^n}{(n + a)^s},\]</div>
<p>where the standard branch of the argument is used for <span class="math notranslate nohighlight">\(n + a\)</span>,
and by analytic continuation for other values of the parameters.</p>
<p>A commonly used related function is the Lerch zeta function, defined by</p>
<div class="math notranslate nohighlight">
\[L(q, s, a) = \Phi(e^{2\pi i q}, s, a).\]</div>
<p><strong>Analytic Continuation and Branching Behavior</strong></p>
<p>It can be shown that</p>
<div class="math notranslate nohighlight">
\[\Phi(z, s, a) = z\Phi(z, s, a+1) + a^{-s}.\]</div>
<p>This provides the analytic continuation to <span class="math notranslate nohighlight">\(\operatorname{Re}(a) \le 0\)</span>.</p>
<p>Assume now <span class="math notranslate nohighlight">\(\operatorname{Re}(a) &gt; 0\)</span>. The integral representation</p>
<div class="math notranslate nohighlight">
\[\Phi_0(z, s, a) = \int_0^\infty \frac{t^{s-1} e^{-at}}{1 - ze^{-t}}
\frac{\mathrm{d}t}{\Gamma(s)}\]</div>
<p>provides an analytic continuation to <span class="math notranslate nohighlight">\(\mathbb{C} - [1, \infty)\)</span>.
Finally, for <span class="math notranslate nohighlight">\(x \in (1, \infty)\)</span> we find</p>
<div class="math notranslate nohighlight">
\[\lim_{\epsilon \to 0^+} \Phi_0(x + i\epsilon, s, a)
-\lim_{\epsilon \to 0^+} \Phi_0(x - i\epsilon, s, a)
= \frac{2\pi i \log^{s-1}{x}}{x^a \Gamma(s)},\]</div>
<p>using the standard branch for both <span class="math notranslate nohighlight">\(\log{x}\)</span> and
<span class="math notranslate nohighlight">\(\log{\log{x}}\)</span> (a branch of <span class="math notranslate nohighlight">\(\log{\log{x}}\)</span> is needed to
evaluate <span class="math notranslate nohighlight">\(\log{x}^{s-1}\)</span>).
This concludes the analytic continuation. The Lerch transcendent is thus
branched at <span class="math notranslate nohighlight">\(z \in \{0, 1, \infty\}\)</span> and
<span class="math notranslate nohighlight">\(a \in \mathbb{Z}_{\le 0}\)</span>. For fixed <span class="math notranslate nohighlight">\(z, a\)</span> outside these
branch points, it is an entire function of <span class="math notranslate nohighlight">\(s\)</span>.</p>
<p class="rubric">Examples</p>
<p>The Lerch transcendent is a fairly general function, for this reason it does
not automatically evaluate to simpler functions. Use <code class="docutils literal notranslate"><span class="pre">expand_func()</span></code> to
achieve this.</p>
<p>If <span class="math notranslate nohighlight">\(z=1\)</span>, the Lerch transcendent reduces to the Hurwitz zeta function:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">lerchphi</span><span class="p">,</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">lerchphi</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="p">))</span>
<span class="go">zeta(s, a)</span>
</pre></div>
</div>
<p>More generally, if <span class="math notranslate nohighlight">\(z\)</span> is a root of unity, the Lerch transcendent
reduces to a sum of Hurwitz zeta functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">lerchphi</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="p">))</span>
<span class="go">zeta(s, a/2)/2**s - zeta(s, a/2 + 1/2)/2**s</span>
</pre></div>
</div>
<p>If <span class="math notranslate nohighlight">\(a=1\)</span>, the Lerch transcendent reduces to the polylogarithm:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">lerchphi</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="mi">1</span><span class="p">))</span>
<span class="go">polylog(s, z)/z</span>
</pre></div>
</div>
<p>More generally, if <span class="math notranslate nohighlight">\(a\)</span> is rational, the Lerch transcendent reduces
to a sum of polylogarithms:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">lerchphi</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">))</span>
<span class="go">2**(s - 1)*(polylog(s, sqrt(z))/sqrt(z) -</span>
<span class="go">            polylog(s, sqrt(z)*exp_polar(I*pi))/sqrt(z))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">lerchphi</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">))</span>
<span class="go">-2**s/z + 2**(s - 1)*(polylog(s, sqrt(z))/sqrt(z) -</span>
<span class="go">                      polylog(s, sqrt(z)*exp_polar(I*pi))/sqrt(z))/z</span>
</pre></div>
</div>
<p>The derivatives with respect to <span class="math notranslate nohighlight">\(z\)</span> and <span class="math notranslate nohighlight">\(a\)</span> can be computed in
closed form:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">lerchphi</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">(-a*lerchphi(z, s, a) + lerchphi(z, s - 1, a))/z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">lerchphi</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">s</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">diff</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
<span class="go">-s*lerchphi(z, s + 1, a)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.zeta_functions.polylog" title="sympy.functions.special.zeta_functions.polylog"><code class="xref py py-obj docutils literal notranslate"><span class="pre">polylog</span></code></a>, <a class="reference internal" href="#sympy.functions.special.zeta_functions.zeta" title="sympy.functions.special.zeta_functions.zeta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zeta</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r398"><span class="brackets"><a class="fn-backref" href="#id115">R398</a></span></dt>
<dd><p>Bateman, H.; Erdelyi, A. (1953), Higher Transcendental Functions,
Vol. I, New York: McGraw-Hill. Section 1.11.</p>
</dd>
<dt class="label" id="r399"><span class="brackets"><a class="fn-backref" href="#id116">R399</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/25.14">http://dlmf.nist.gov/25.14</a></p>
</dd>
<dt class="label" id="r400"><span class="brackets"><a class="fn-backref" href="#id117">R400</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Lerch_transcendent">https://en.wikipedia.org/wiki/Lerch_transcendent</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.zeta_functions.stieltjes">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.zeta_functions.</span></span><span class="sig-name descname"><span class="pre">stieltjes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/zeta_functions.py#L656-L721"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.zeta_functions.stieltjes" title="Permalink to this definition">¶</a></dt>
<dd><p>Represents Stieltjes constants, <span class="math notranslate nohighlight">\(\gamma_{k}\)</span> that occur in
Laurent Series expansion of the Riemann zeta function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">stieltjes</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span> <span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">stieltjes</span><span class="p">(</span><span class="n">n</span><span class="p">)</span>
<span class="go">stieltjes(n)</span>
</pre></div>
</div>
<p>The zero’th stieltjes constant:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">stieltjes</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">EulerGamma</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">stieltjes</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">EulerGamma</span>
</pre></div>
</div>
<p>For generalized stieltjes constants:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">stieltjes</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">)</span>
<span class="go">stieltjes(n, m)</span>
</pre></div>
</div>
<p>Constants are only defined for integers &gt;= 0:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">stieltjes</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">zoo</span>
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r401"><span class="brackets"><a class="fn-backref" href="#id118">R401</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Stieltjes_constants">https://en.wikipedia.org/wiki/Stieltjes_constants</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="hypergeometric-functions">
<h2>Hypergeometric Functions<a class="headerlink" href="#hypergeometric-functions" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.hyper">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.hyper.</span></span><span class="sig-name descname"><span class="pre">hyper</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">ap</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bq</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/hyper.py#L67-L356"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.hyper.hyper" title="Permalink to this definition">¶</a></dt>
<dd><p>The generalized hypergeometric function is defined by a series where
the ratios of successive terms are a rational function of the summation
index. When convergent, it is continued analytically to the largest
possible domain.</p>
<p class="rubric">Explanation</p>
<p>The hypergeometric function depends on two vectors of parameters, called
the numerator parameters <span class="math notranslate nohighlight">\(a_p\)</span>, and the denominator parameters
<span class="math notranslate nohighlight">\(b_q\)</span>. It also has an argument <span class="math notranslate nohighlight">\(z\)</span>. The series definition is</p>
<div class="math notranslate nohighlight">
\[\begin{split}{}_pF_q\left(\begin{matrix} a_1, \cdots, a_p \\ b_1, \cdots, b_q \end{matrix}
             \middle| z \right)
= \sum_{n=0}^\infty \frac{(a_1)_n \cdots (a_p)_n}{(b_1)_n \cdots (b_q)_n}
                    \frac{z^n}{n!},\end{split}\]</div>
<p>where <span class="math notranslate nohighlight">\((a)_n = (a)(a+1)\cdots(a+n-1)\)</span> denotes the rising factorial.</p>
<p>If one of the <span class="math notranslate nohighlight">\(b_q\)</span> is a non-positive integer then the series is
undefined unless one of the <span class="math notranslate nohighlight">\(a_p\)</span> is a larger (i.e., smaller in
magnitude) non-positive integer. If none of the <span class="math notranslate nohighlight">\(b_q\)</span> is a
non-positive integer and one of the <span class="math notranslate nohighlight">\(a_p\)</span> is a non-positive
integer, then the series reduces to a polynomial. To simplify the
following discussion, we assume that none of the <span class="math notranslate nohighlight">\(a_p\)</span> or
<span class="math notranslate nohighlight">\(b_q\)</span> is a non-positive integer. For more details, see the
references.</p>
<p>The series converges for all <span class="math notranslate nohighlight">\(z\)</span> if <span class="math notranslate nohighlight">\(p \le q\)</span>, and thus
defines an entire single-valued function in this case. If <span class="math notranslate nohighlight">\(p =
q+1\)</span> the series converges for <span class="math notranslate nohighlight">\(|z| &lt; 1\)</span>, and can be continued
analytically into a half-plane. If <span class="math notranslate nohighlight">\(p &gt; q+1\)</span> the series is
divergent for all <span class="math notranslate nohighlight">\(z\)</span>.</p>
<p>Please note the hypergeometric function constructor currently does <em>not</em>
check if the parameters actually yield a well-defined function.</p>
<p class="rubric">Examples</p>
<p>The parameters <span class="math notranslate nohighlight">\(a_p\)</span> and <span class="math notranslate nohighlight">\(b_q\)</span> can be passed as arbitrary
iterables, for example:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">hyper</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyper</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">],</span> <span class="n">x</span><span class="p">)</span>
<span class="go">hyper((1, 2, 3), (3, 4), x)</span>
</pre></div>
</div>
<p>There is also pretty printing (it looks better using Unicode):</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">hyper</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">[</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">],</span> <span class="n">x</span><span class="p">),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go">  _</span>
<span class="go"> |_  /1, 2, 3 |  \</span>
<span class="go"> |   |        | x|</span>
<span class="go">3  2 \  3, 4  |  /</span>
</pre></div>
</div>
<p>The parameters must always be iterables, even if they are vectors of
length one or zero:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">hyper</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="p">),</span> <span class="p">[],</span> <span class="n">x</span><span class="p">)</span>
<span class="go">hyper((1,), (), x)</span>
</pre></div>
</div>
<p>But of course they may be variables (but if they depend on <span class="math notranslate nohighlight">\(x\)</span> then you
should not expect much implemented functionality):</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">hyper</span><span class="p">((</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">),</span> <span class="p">(</span><span class="n">n</span><span class="o">**</span><span class="mi">2</span><span class="p">,),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">hyper((n, a), (n**2,), x)</span>
</pre></div>
</div>
<p>The hypergeometric function generalizes many named special functions.
The function <code class="docutils literal notranslate"><span class="pre">hyperexpand()</span></code> tries to express a hypergeometric function
using named special functions. For example:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hyperexpand</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyperexpand</span><span class="p">(</span><span class="n">hyper</span><span class="p">([],</span> <span class="p">[],</span> <span class="n">x</span><span class="p">))</span>
<span class="go">exp(x)</span>
</pre></div>
</div>
<p>You can also use <code class="docutils literal notranslate"><span class="pre">expand_func()</span></code>:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">hyper</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="o">-</span><span class="n">x</span><span class="p">))</span>
<span class="go">log(x + 1)</span>
</pre></div>
</div>
<p>More examples:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyperexpand</span><span class="p">(</span><span class="n">hyper</span><span class="p">([],</span> <span class="p">[</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">],</span> <span class="o">-</span><span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="o">/</span><span class="mi">4</span><span class="p">))</span>
<span class="go">cos(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyperexpand</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">hyper</span><span class="p">([</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="n">S</span><span class="p">(</span><span class="mi">3</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">],</span> <span class="n">x</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">asin(x)</span>
</pre></div>
</div>
<p>We can also sometimes <code class="docutils literal notranslate"><span class="pre">hyperexpand()</span></code> parametric functions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyperexpand</span><span class="p">(</span><span class="n">hyper</span><span class="p">([</span><span class="o">-</span><span class="n">a</span><span class="p">],</span> <span class="p">[],</span> <span class="n">x</span><span class="p">))</span>
<span class="go">(1 - x)**a</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="../simplify/simplify.html#module-sympy.simplify.hyperexpand" title="sympy.simplify.hyperexpand"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.simplify.hyperexpand</span></code></a>, <a class="reference internal" href="#sympy.functions.special.gamma_functions.gamma" title="sympy.functions.special.gamma_functions.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a>, <a class="reference internal" href="#sympy.functions.special.hyper.meijerg" title="sympy.functions.special.hyper.meijerg"><code class="xref py py-obj docutils literal notranslate"><span class="pre">meijerg</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r402"><span class="brackets"><a class="fn-backref" href="#id119">R402</a></span></dt>
<dd><p>Luke, Y. L. (1969), The Special Functions and Their Approximations,
Volume 1</p>
</dd>
<dt class="label" id="r403"><span class="brackets"><a class="fn-backref" href="#id120">R403</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Generalized_hypergeometric_function">https://en.wikipedia.org/wiki/Generalized_hypergeometric_function</a></p>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.hyper.ap">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">ap</span></span><a class="headerlink" href="#sympy.functions.special.hyper.hyper.ap" title="Permalink to this definition">¶</a></dt>
<dd><p>Numerator parameters of the hypergeometric function.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.hyper.argument">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">argument</span></span><a class="headerlink" href="#sympy.functions.special.hyper.hyper.argument" title="Permalink to this definition">¶</a></dt>
<dd><p>Argument of the hypergeometric function.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.hyper.bq">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">bq</span></span><a class="headerlink" href="#sympy.functions.special.hyper.hyper.bq" title="Permalink to this definition">¶</a></dt>
<dd><p>Denominator parameters of the hypergeometric function.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.hyper.convergence_statement">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">convergence_statement</span></span><a class="headerlink" href="#sympy.functions.special.hyper.hyper.convergence_statement" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a condition on z under which the series converges.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.hyper.eta">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">eta</span></span><a class="headerlink" href="#sympy.functions.special.hyper.hyper.eta" title="Permalink to this definition">¶</a></dt>
<dd><p>A quantity related to the convergence of the series.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.hyper.radius_of_convergence">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">radius_of_convergence</span></span><a class="headerlink" href="#sympy.functions.special.hyper.hyper.radius_of_convergence" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the radius of convergence of the defining series.</p>
<p class="rubric">Explanation</p>
<p>Note that even if this is not <code class="docutils literal notranslate"><span class="pre">oo</span></code>, the function may still be
evaluated outside of the radius of convergence by analytic
continuation. But if this is zero, then the function is not actually
defined anywhere else.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">hyper</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyper</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">radius_of_convergence</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyper</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">),</span> <span class="p">[</span><span class="mi">4</span><span class="p">],</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">radius_of_convergence</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyper</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">radius_of_convergence</span>
<span class="go">oo</span>
</pre></div>
</div>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.hyper.</span></span><span class="sig-name descname"><span class="pre">meijerg</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/hyper.py#L359-L765"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.hyper.meijerg" title="Permalink to this definition">¶</a></dt>
<dd><p>The Meijer G-function is defined by a Mellin-Barnes type integral that
resembles an inverse Mellin transform. It generalizes the hypergeometric
functions.</p>
<p class="rubric">Explanation</p>
<p>The Meijer G-function depends on four sets of parameters. There are
“<em>numerator parameters</em>”
<span class="math notranslate nohighlight">\(a_1, \ldots, a_n\)</span> and <span class="math notranslate nohighlight">\(a_{n+1}, \ldots, a_p\)</span>, and there are
“<em>denominator parameters</em>”
<span class="math notranslate nohighlight">\(b_1, \ldots, b_m\)</span> and <span class="math notranslate nohighlight">\(b_{m+1}, \ldots, b_q\)</span>.
Confusingly, it is traditionally denoted as follows (note the position
of <span class="math notranslate nohighlight">\(m\)</span>, <span class="math notranslate nohighlight">\(n\)</span>, <span class="math notranslate nohighlight">\(p\)</span>, <span class="math notranslate nohighlight">\(q\)</span>, and how they relate to the lengths of the four
parameter vectors):</p>
<div class="math notranslate nohighlight">
\[\begin{split}G_{p,q}^{m,n} \left(\begin{matrix}a_1, \cdots, a_n &amp; a_{n+1}, \cdots, a_p \\
                                b_1, \cdots, b_m &amp; b_{m+1}, \cdots, b_q
                  \end{matrix} \middle| z \right).\end{split}\]</div>
<p>However, in SymPy the four parameter vectors are always available
separately (see examples), so that there is no need to keep track of the
decorating sub- and super-scripts on the G symbol.</p>
<p>The G function is defined as the following integral:</p>
<div class="math notranslate nohighlight">
\[\frac{1}{2 \pi i} \int_L \frac{\prod_{j=1}^m \Gamma(b_j - s)
\prod_{j=1}^n \Gamma(1 - a_j + s)}{\prod_{j=m+1}^q \Gamma(1- b_j +s)
\prod_{j=n+1}^p \Gamma(a_j - s)} z^s \mathrm{d}s,\]</div>
<p>where <span class="math notranslate nohighlight">\(\Gamma(z)\)</span> is the gamma function. There are three possible
contours which we will not describe in detail here (see the references).
If the integral converges along more than one of them, the definitions
agree. The contours all separate the poles of <span class="math notranslate nohighlight">\(\Gamma(1-a_j+s)\)</span>
from the poles of <span class="math notranslate nohighlight">\(\Gamma(b_k-s)\)</span>, so in particular the G function
is undefined if <span class="math notranslate nohighlight">\(a_j - b_k \in \mathbb{Z}_{&gt;0}\)</span> for some
<span class="math notranslate nohighlight">\(j \le n\)</span> and <span class="math notranslate nohighlight">\(k \le m\)</span>.</p>
<p>The conditions under which one of the contours yields a convergent integral
are complicated and we do not state them here, see the references.</p>
<p>Please note currently the Meijer G-function constructor does <em>not</em> check any
convergence conditions.</p>
<p class="rubric">Examples</p>
<p>You can pass the parameters either as four separate vectors:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions</span> <span class="kn">import</span> <span class="n">meijerg</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.core.containers</span> <span class="kn">import</span> <span class="n">Tuple</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">meijerg</span><span class="p">((</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="mi">4</span><span class="p">),</span> <span class="p">(</span><span class="mi">5</span><span class="p">,),</span> <span class="p">[],</span> <span class="n">x</span><span class="p">),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go"> __1, 2 /1, 2  a, 4 |  \</span>
<span class="go">/__     |           | x|</span>
<span class="go">\_|4, 1 \ 5         |  /</span>
</pre></div>
</div>
<p>Or as two nested vectors:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">meijerg</span><span class="p">([(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">),</span> <span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">)],</span> <span class="p">([</span><span class="mi">5</span><span class="p">],</span> <span class="n">Tuple</span><span class="p">()),</span> <span class="n">x</span><span class="p">),</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go"> __1, 2 /1, 2  3, 4 |  \</span>
<span class="go">/__     |           | x|</span>
<span class="go">\_|4, 1 \ 5         |  /</span>
</pre></div>
</div>
<p>As with the hypergeometric function, the parameters may be passed as
arbitrary iterables. Vectors of length zero and one also have to be
passed as iterables. The parameters need not be constants, but if they
depend on the argument then not much implemented functionality should be
expected.</p>
<p>All the subvectors of parameters are available:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pprint</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span> <span class="o">=</span> <span class="n">meijerg</span><span class="p">([</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="p">[</span><span class="mi">4</span><span class="p">],</span> <span class="n">x</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pprint</span><span class="p">(</span><span class="n">g</span><span class="p">,</span> <span class="n">use_unicode</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
<span class="go"> __1, 1 /1  2 |  \</span>
<span class="go">/__     |     | x|</span>
<span class="go">\_|2, 2 \3  4 |  /</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">an</span>
<span class="go">(1,)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">ap</span>
<span class="go">(1, 2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">aother</span>
<span class="go">(2,)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">bm</span>
<span class="go">(3,)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">bq</span>
<span class="go">(3, 4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">g</span><span class="o">.</span><span class="n">bother</span>
<span class="go">(4,)</span>
</pre></div>
</div>
<p>The Meijer G-function generalizes the hypergeometric functions.
In some cases it can be expressed in terms of hypergeometric functions,
using Slater’s theorem. For example:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hyperexpand</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyperexpand</span><span class="p">(</span><span class="n">meijerg</span><span class="p">([</span><span class="n">a</span><span class="p">],</span> <span class="p">[],</span> <span class="p">[</span><span class="n">c</span><span class="p">],</span> <span class="p">[</span><span class="n">b</span><span class="p">],</span> <span class="n">x</span><span class="p">),</span> <span class="n">allow_hyper</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="go">x**c*gamma(-a + c + 1)*hyper((-a + c + 1,),</span>
<span class="go">                             (-b + c + 1,), -x)/gamma(-b + c + 1)</span>
</pre></div>
</div>
<p>Thus the Meijer G-function also subsumes many named functions as special
cases. You can use <code class="docutils literal notranslate"><span class="pre">expand_func()</span></code> or <code class="docutils literal notranslate"><span class="pre">hyperexpand()</span></code> to (try to)
rewrite a Meijer G-function in terms of named special functions. For
example:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">expand_func</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">meijerg</span><span class="p">([[],[]],</span> <span class="p">[[</span><span class="mi">0</span><span class="p">],[]],</span> <span class="o">-</span><span class="n">x</span><span class="p">))</span>
<span class="go">exp(x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hyperexpand</span><span class="p">(</span><span class="n">meijerg</span><span class="p">([[],[]],</span> <span class="p">[[</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">],[</span><span class="mi">0</span><span class="p">]],</span> <span class="p">(</span><span class="n">x</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span><span class="p">))</span>
<span class="go">sin(x)/sqrt(pi)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.hyper.hyper" title="sympy.functions.special.hyper.hyper"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hyper</span></code></a>, <a class="reference internal" href="../simplify/simplify.html#module-sympy.simplify.hyperexpand" title="sympy.simplify.hyperexpand"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.simplify.hyperexpand</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r404"><span class="brackets"><a class="fn-backref" href="#id121">R404</a></span></dt>
<dd><p>Luke, Y. L. (1969), The Special Functions and Their Approximations,
Volume 1</p>
</dd>
<dt class="label" id="r405"><span class="brackets"><a class="fn-backref" href="#id122">R405</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Meijer_G-function">https://en.wikipedia.org/wiki/Meijer_G-function</a></p>
</dd>
</dl>
<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.an">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">an</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.an" title="Permalink to this definition">¶</a></dt>
<dd><p>First set of numerator parameters.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.aother">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">aother</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.aother" title="Permalink to this definition">¶</a></dt>
<dd><p>Second set of numerator parameters.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.ap">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">ap</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.ap" title="Permalink to this definition">¶</a></dt>
<dd><p>Combined numerator parameters.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.argument">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">argument</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.argument" title="Permalink to this definition">¶</a></dt>
<dd><p>Argument of the Meijer G-function.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.bm">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">bm</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.bm" title="Permalink to this definition">¶</a></dt>
<dd><p>First set of denominator parameters.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.bother">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">bother</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.bother" title="Permalink to this definition">¶</a></dt>
<dd><p>Second set of denominator parameters.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.bq">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">bq</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.bq" title="Permalink to this definition">¶</a></dt>
<dd><p>Combined denominator parameters.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.delta">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">delta</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.delta" title="Permalink to this definition">¶</a></dt>
<dd><p>A quantity related to the convergence region of the integral,
c.f. references.</p>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.get_period">
<span class="sig-name descname"><span class="pre">get_period</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/hyper.py#L617-L658"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.get_period" title="Permalink to this definition">¶</a></dt>
<dd><p>Return a number <span class="math notranslate nohighlight">\(P\)</span> such that <span class="math notranslate nohighlight">\(G(x*exp(I*P)) == G(x)\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.hyper</span> <span class="kn">import</span> <span class="n">meijerg</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">pi</span><span class="p">,</span> <span class="n">S</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">meijerg</span><span class="p">([</span><span class="mi">1</span><span class="p">],</span> <span class="p">[],</span> <span class="p">[],</span> <span class="p">[],</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">get_period</span><span class="p">()</span>
<span class="go">2*pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">meijerg</span><span class="p">([</span><span class="n">pi</span><span class="p">],</span> <span class="p">[],</span> <span class="p">[],</span> <span class="p">[],</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">get_period</span><span class="p">()</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">meijerg</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">],</span> <span class="p">[],</span> <span class="p">[],</span> <span class="p">[],</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">get_period</span><span class="p">()</span>
<span class="go">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">meijerg</span><span class="p">([</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">],</span> <span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">3</span><span class="p">],</span> <span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">z</span><span class="p">)</span><span class="o">.</span><span class="n">get_period</span><span class="p">()</span>
<span class="go">12*pi</span>
</pre></div>
</div>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.integrand">
<span class="sig-name descname"><span class="pre">integrand</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">s</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/hyper.py#L702-L709"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.integrand" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the defining integrand D(s).</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.is_number">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_number</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.is_number" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns true if expression has numeric data only.</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.meijerg.nu">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">nu</span></span><a class="headerlink" href="#sympy.functions.special.hyper.meijerg.nu" title="Permalink to this definition">¶</a></dt>
<dd><p>A quantity related to the convergence region of the integral,
c.f. references.</p>
</dd></dl>

</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.hyper.appellf1">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.hyper.</span></span><span class="sig-name descname"><span class="pre">appellf1</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b2</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">c</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">y</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/hyper.py#L1103-L1160"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.hyper.appellf1" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the Appell hypergeometric function of two variables as:</p>
<div class="math notranslate nohighlight">
\[F_1(a,b_1,b_2,c,x,y) = \sum_{m=0}^{\infty} \sum_{n=0}^{\infty}
\frac{(a)_{m+n} (b_1)_m (b_2)_n}{(c)_{m+n}}
\frac{x^m y^n}{m! n!}.\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.hyper</span> <span class="kn">import</span> <span class="n">appellf1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">,</span> <span class="n">c</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x y a b1 b2 c&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">appellf1</span><span class="p">(</span><span class="mf">2.</span><span class="p">,</span> <span class="mf">1.</span><span class="p">,</span> <span class="mf">6.</span><span class="p">,</span> <span class="mf">4.</span><span class="p">,</span> <span class="mf">5.</span><span class="p">,</span> <span class="mf">6.</span><span class="p">)</span>
<span class="go">0.0063339426292673</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">appellf1</span><span class="p">(</span><span class="mf">12.</span><span class="p">,</span> <span class="mf">12.</span><span class="p">,</span> <span class="mf">6.</span><span class="p">,</span> <span class="mf">4.</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.12</span><span class="p">)</span>
<span class="go">172870711.659936</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">appellf1</span><span class="p">(</span><span class="mi">40</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">60</span><span class="p">)</span>
<span class="go">appellf1(40, 2, 6, 4, 15, 60)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">appellf1</span><span class="p">(</span><span class="mf">20.</span><span class="p">,</span> <span class="mf">12.</span><span class="p">,</span> <span class="mf">10.</span><span class="p">,</span> <span class="mf">3.</span><span class="p">,</span> <span class="mf">0.5</span><span class="p">,</span> <span class="mf">0.12</span><span class="p">)</span>
<span class="go">15605338197184.4</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">appellf1</span><span class="p">(</span><span class="mi">40</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">appellf1(40, 2, 6, 4, x, y)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">appellf1</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">)</span>
<span class="go">appellf1(a, b1, b2, c, x, y)</span>
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r406"><span class="brackets"><a class="fn-backref" href="#id123">R406</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Appell_series">https://en.wikipedia.org/wiki/Appell_series</a></p>
</dd>
<dt class="label" id="r407"><span class="brackets"><a class="fn-backref" href="#id124">R407</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/HypergeometricFunctions/AppellF1/">http://functions.wolfram.com/HypergeometricFunctions/AppellF1/</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-sympy.functions.special.elliptic_integrals">
<span id="elliptic-integrals"></span><h2>Elliptic integrals<a class="headerlink" href="#module-sympy.functions.special.elliptic_integrals" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.elliptic_integrals.elliptic_k">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.elliptic_integrals.</span></span><span class="sig-name descname"><span class="pre">elliptic_k</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/elliptic_integrals.py#L12-L99"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.elliptic_integrals.elliptic_k" title="Permalink to this definition">¶</a></dt>
<dd><p>The complete elliptic integral of the first kind, defined by</p>
<div class="math notranslate nohighlight">
\[K(m) = F\left(\tfrac{\pi}{2}\middle| m\right)\]</div>
<p>where <span class="math notranslate nohighlight">\(F\left(z\middle| m\right)\)</span> is the Legendre incomplete
elliptic integral of the first kind.</p>
<p class="rubric">Explanation</p>
<p>The function <span class="math notranslate nohighlight">\(K(m)\)</span> is a single-valued function on the complex
plane with branch cut along the interval <span class="math notranslate nohighlight">\((1, \infty)\)</span>.</p>
<p>Note that our notation defines the incomplete elliptic integral
in terms of the parameter <span class="math notranslate nohighlight">\(m\)</span> instead of the elliptic modulus
(eccentricity) <span class="math notranslate nohighlight">\(k\)</span>.
In this case, the parameter <span class="math notranslate nohighlight">\(m\)</span> is defined as <span class="math notranslate nohighlight">\(m=k^2\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">elliptic_k</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_k</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_k</span><span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span>
<span class="go">1.50923695405127 + 0.625146415202697*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_k</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="o">.</span><span class="n">series</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
<span class="go">pi/2 + pi*m/8 + 9*pi*m**2/128 + O(m**3)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.elliptic_integrals.elliptic_f" title="sympy.functions.special.elliptic_integrals.elliptic_f"><code class="xref py py-obj docutils literal notranslate"><span class="pre">elliptic_f</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r408"><span class="brackets"><a class="fn-backref" href="#id125">R408</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Elliptic_integrals">https://en.wikipedia.org/wiki/Elliptic_integrals</a></p>
</dd>
<dt class="label" id="r409"><span class="brackets"><a class="fn-backref" href="#id126">R409</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/EllipticIntegrals/EllipticK">http://functions.wolfram.com/EllipticIntegrals/EllipticK</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.elliptic_integrals.elliptic_f">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.elliptic_integrals.</span></span><span class="sig-name descname"><span class="pre">elliptic_f</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/elliptic_integrals.py#L102-L184"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.elliptic_integrals.elliptic_f" title="Permalink to this definition">¶</a></dt>
<dd><p>The Legendre incomplete elliptic integral of the first
kind, defined by</p>
<div class="math notranslate nohighlight">
\[F\left(z\middle| m\right) =
\int_0^z \frac{dt}{\sqrt{1 - m \sin^2 t}}\]</div>
<p class="rubric">Explanation</p>
<p>This function reduces to a complete elliptic integral of
the first kind, <span class="math notranslate nohighlight">\(K(m)\)</span>, when <span class="math notranslate nohighlight">\(z = \pi/2\)</span>.</p>
<p>Note that our notation defines the incomplete elliptic integral
in terms of the parameter <span class="math notranslate nohighlight">\(m\)</span> instead of the elliptic modulus
(eccentricity) <span class="math notranslate nohighlight">\(k\)</span>.
In this case, the parameter <span class="math notranslate nohighlight">\(m\)</span> is defined as <span class="math notranslate nohighlight">\(m=k^2\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">elliptic_f</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_f</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">m</span><span class="p">)</span><span class="o">.</span><span class="n">series</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">z + z**5*(3*m**2/40 - m/30) + m*z**3/6 + O(z**6)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_f</span><span class="p">(</span><span class="mf">3.0</span> <span class="o">+</span> <span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="mf">1.0</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span>
<span class="go">2.909449841483 + 1.74720545502474*I</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.elliptic_integrals.elliptic_k" title="sympy.functions.special.elliptic_integrals.elliptic_k"><code class="xref py py-obj docutils literal notranslate"><span class="pre">elliptic_k</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r410"><span class="brackets"><a class="fn-backref" href="#id127">R410</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Elliptic_integrals">https://en.wikipedia.org/wiki/Elliptic_integrals</a></p>
</dd>
<dt class="label" id="r411"><span class="brackets"><a class="fn-backref" href="#id128">R411</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/EllipticIntegrals/EllipticF">http://functions.wolfram.com/EllipticIntegrals/EllipticF</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.elliptic_integrals.elliptic_e">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.elliptic_integrals.</span></span><span class="sig-name descname"><span class="pre">elliptic_e</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/elliptic_integrals.py#L187-L306"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.elliptic_integrals.elliptic_e" title="Permalink to this definition">¶</a></dt>
<dd><p>Called with two arguments <span class="math notranslate nohighlight">\(z\)</span> and <span class="math notranslate nohighlight">\(m\)</span>, evaluates the
incomplete elliptic integral of the second kind, defined by</p>
<div class="math notranslate nohighlight">
\[E\left(z\middle| m\right) = \int_0^z \sqrt{1 - m \sin^2 t} dt\]</div>
<p>Called with a single argument <span class="math notranslate nohighlight">\(m\)</span>, evaluates the Legendre complete
elliptic integral of the second kind</p>
<div class="math notranslate nohighlight">
\[E(m) = E\left(\tfrac{\pi}{2}\middle| m\right)\]</div>
<p class="rubric">Explanation</p>
<p>The function <span class="math notranslate nohighlight">\(E(m)\)</span> is a single-valued function on the complex
plane with branch cut along the interval <span class="math notranslate nohighlight">\((1, \infty)\)</span>.</p>
<p>Note that our notation defines the incomplete elliptic integral
in terms of the parameter <span class="math notranslate nohighlight">\(m\)</span> instead of the elliptic modulus
(eccentricity) <span class="math notranslate nohighlight">\(k\)</span>.
In this case, the parameter <span class="math notranslate nohighlight">\(m\)</span> is defined as <span class="math notranslate nohighlight">\(m=k^2\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">elliptic_e</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_e</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">m</span><span class="p">)</span><span class="o">.</span><span class="n">series</span><span class="p">(</span><span class="n">z</span><span class="p">)</span>
<span class="go">z + z**5*(-m**2/40 + m/30) - m*z**3/6 + O(z**6)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_e</span><span class="p">(</span><span class="n">m</span><span class="p">)</span><span class="o">.</span><span class="n">series</span><span class="p">(</span><span class="n">n</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
<span class="go">pi/2 - pi*m/8 - 3*pi*m**2/128 - 5*pi*m**3/512 + O(m**4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_e</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">I</span><span class="p">,</span> <span class="mi">2</span> <span class="o">-</span> <span class="n">I</span><span class="o">/</span><span class="mi">2</span><span class="p">)</span><span class="o">.</span><span class="n">n</span><span class="p">()</span>
<span class="go">1.55203744279187 + 0.290764986058437*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_e</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_e</span><span class="p">(</span><span class="mf">2.0</span> <span class="o">-</span> <span class="n">I</span><span class="p">)</span>
<span class="go">0.991052601328069 + 0.81879421395609*I</span>
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r412"><span class="brackets"><a class="fn-backref" href="#id129">R412</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Elliptic_integrals">https://en.wikipedia.org/wiki/Elliptic_integrals</a></p>
</dd>
<dt class="label" id="r413"><span class="brackets"><a class="fn-backref" href="#id130">R413</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/EllipticIntegrals/EllipticE2">http://functions.wolfram.com/EllipticIntegrals/EllipticE2</a></p>
</dd>
<dt class="label" id="r414"><span class="brackets"><a class="fn-backref" href="#id131">R414</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/EllipticIntegrals/EllipticE">http://functions.wolfram.com/EllipticIntegrals/EllipticE</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.elliptic_integrals.elliptic_pi">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.elliptic_integrals.</span></span><span class="sig-name descname"><span class="pre">elliptic_pi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/elliptic_integrals.py#L309-L444"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.elliptic_integrals.elliptic_pi" title="Permalink to this definition">¶</a></dt>
<dd><p>Called with three arguments <span class="math notranslate nohighlight">\(n\)</span>, <span class="math notranslate nohighlight">\(z\)</span> and <span class="math notranslate nohighlight">\(m\)</span>, evaluates the
Legendre incomplete elliptic integral of the third kind, defined by</p>
<div class="math notranslate nohighlight">
\[\Pi\left(n; z\middle| m\right) = \int_0^z \frac{dt}
{\left(1 - n \sin^2 t\right) \sqrt{1 - m \sin^2 t}}\]</div>
<p>Called with two arguments <span class="math notranslate nohighlight">\(n\)</span> and <span class="math notranslate nohighlight">\(m\)</span>, evaluates the complete
elliptic integral of the third kind:</p>
<div class="math notranslate nohighlight">
\[\Pi\left(n\middle| m\right) =
\Pi\left(n; \tfrac{\pi}{2}\middle| m\right)\]</div>
<p class="rubric">Explanation</p>
<p>Note that our notation defines the incomplete elliptic integral
in terms of the parameter <span class="math notranslate nohighlight">\(m\)</span> instead of the elliptic modulus
(eccentricity) <span class="math notranslate nohighlight">\(k\)</span>.
In this case, the parameter <span class="math notranslate nohighlight">\(m\)</span> is defined as <span class="math notranslate nohighlight">\(m=k^2\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">elliptic_pi</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">z</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_pi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">z</span><span class="p">,</span> <span class="n">m</span><span class="p">)</span><span class="o">.</span><span class="n">series</span><span class="p">(</span><span class="n">z</span><span class="p">,</span> <span class="n">n</span><span class="o">=</span><span class="mi">4</span><span class="p">)</span>
<span class="go">z + z**3*(m/6 + n/3) + O(z**4)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_pi</span><span class="p">(</span><span class="mf">0.5</span> <span class="o">+</span> <span class="n">I</span><span class="p">,</span> <span class="mf">1.0</span> <span class="o">-</span> <span class="n">I</span><span class="p">,</span> <span class="mf">1.2</span><span class="p">)</span>
<span class="go">2.50232379629182 - 0.760939574180767*I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_pi</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">pi/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">elliptic_pi</span><span class="p">(</span><span class="mf">1.0</span> <span class="o">-</span> <span class="n">I</span><span class="o">/</span><span class="mi">3</span><span class="p">,</span> <span class="mf">2.0</span> <span class="o">+</span> <span class="n">I</span><span class="p">)</span>
<span class="go">3.29136443417283 + 0.32555634906645*I</span>
</pre></div>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r415"><span class="brackets"><a class="fn-backref" href="#id132">R415</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Elliptic_integrals">https://en.wikipedia.org/wiki/Elliptic_integrals</a></p>
</dd>
<dt class="label" id="r416"><span class="brackets"><a class="fn-backref" href="#id133">R416</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/EllipticIntegrals/EllipticPi3">http://functions.wolfram.com/EllipticIntegrals/EllipticPi3</a></p>
</dd>
<dt class="label" id="r417"><span class="brackets"><a class="fn-backref" href="#id134">R417</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/EllipticIntegrals/EllipticPi">http://functions.wolfram.com/EllipticIntegrals/EllipticPi</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-sympy.functions.special.mathieu_functions">
<span id="mathieu-functions"></span><h2>Mathieu Functions<a class="headerlink" href="#module-sympy.functions.special.mathieu_functions" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.mathieu_functions.MathieuBase">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.mathieu_functions.</span></span><span class="sig-name descname"><span class="pre">MathieuBase</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/mathieu_functions.py#L9-L21"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.mathieu_functions.MathieuBase" title="Permalink to this definition">¶</a></dt>
<dd><p>Abstract base class for Mathieu functions.</p>
<p>This class is meant to reduce code duplication.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.mathieu_functions.mathieus">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.mathieu_functions.</span></span><span class="sig-name descname"><span class="pre">mathieus</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">q</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/mathieu_functions.py#L24-L83"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.mathieu_functions.mathieus" title="Permalink to this definition">¶</a></dt>
<dd><p>The Mathieu Sine function <span class="math notranslate nohighlight">\(S(a,q,z)\)</span>.</p>
<p class="rubric">Explanation</p>
<p>This function is one solution of the Mathieu differential equation:</p>
<div class="math notranslate nohighlight">
\[y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0\]</div>
<p>The other solution is the Mathieu Cosine function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span><span class="p">,</span> <span class="n">mathieus</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieus</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">mathieus(a, q, z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieus</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">sin(sqrt(a)*z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">mathieus</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">mathieusprime(a, q, z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieuc" title="sympy.functions.special.mathieu_functions.mathieuc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieuc</span></code></a></dt><dd><p>Mathieu cosine function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieusprime" title="sympy.functions.special.mathieu_functions.mathieusprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieusprime</span></code></a></dt><dd><p>Derivative of Mathieu sine function.</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieucprime" title="sympy.functions.special.mathieu_functions.mathieucprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieucprime</span></code></a></dt><dd><p>Derivative of Mathieu cosine function.</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r418"><span class="brackets"><a class="fn-backref" href="#id135">R418</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Mathieu_function">https://en.wikipedia.org/wiki/Mathieu_function</a></p>
</dd>
<dt class="label" id="r419"><span class="brackets"><a class="fn-backref" href="#id136">R419</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/28">http://dlmf.nist.gov/28</a></p>
</dd>
<dt class="label" id="r420"><span class="brackets"><a class="fn-backref" href="#id137">R420</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/MathieuBase.html">http://mathworld.wolfram.com/MathieuBase.html</a></p>
</dd>
<dt class="label" id="r421"><span class="brackets"><a class="fn-backref" href="#id138">R421</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuS/">http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuS/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.mathieu_functions.mathieuc">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.mathieu_functions.</span></span><span class="sig-name descname"><span class="pre">mathieuc</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">q</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/mathieu_functions.py#L86-L145"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.mathieu_functions.mathieuc" title="Permalink to this definition">¶</a></dt>
<dd><p>The Mathieu Cosine function <span class="math notranslate nohighlight">\(C(a,q,z)\)</span>.</p>
<p class="rubric">Explanation</p>
<p>This function is one solution of the Mathieu differential equation:</p>
<div class="math notranslate nohighlight">
\[y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0\]</div>
<p>The other solution is the Mathieu Sine function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span><span class="p">,</span> <span class="n">mathieuc</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieuc</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">mathieuc(a, q, z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieuc</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">cos(sqrt(a)*z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">mathieuc</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">mathieucprime(a, q, z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieus" title="sympy.functions.special.mathieu_functions.mathieus"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieus</span></code></a></dt><dd><p>Mathieu sine function</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieusprime" title="sympy.functions.special.mathieu_functions.mathieusprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieusprime</span></code></a></dt><dd><p>Derivative of Mathieu sine function</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieucprime" title="sympy.functions.special.mathieu_functions.mathieucprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieucprime</span></code></a></dt><dd><p>Derivative of Mathieu cosine function</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r422"><span class="brackets"><a class="fn-backref" href="#id139">R422</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Mathieu_function">https://en.wikipedia.org/wiki/Mathieu_function</a></p>
</dd>
<dt class="label" id="r423"><span class="brackets"><a class="fn-backref" href="#id140">R423</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/28">http://dlmf.nist.gov/28</a></p>
</dd>
<dt class="label" id="r424"><span class="brackets"><a class="fn-backref" href="#id141">R424</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/MathieuBase.html">http://mathworld.wolfram.com/MathieuBase.html</a></p>
</dd>
<dt class="label" id="r425"><span class="brackets"><a class="fn-backref" href="#id142">R425</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuC/">http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuC/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.mathieu_functions.mathieusprime">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.mathieu_functions.</span></span><span class="sig-name descname"><span class="pre">mathieusprime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">q</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/mathieu_functions.py#L148-L207"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.mathieu_functions.mathieusprime" title="Permalink to this definition">¶</a></dt>
<dd><p>The derivative <span class="math notranslate nohighlight">\(S^{\prime}(a,q,z)\)</span> of the Mathieu Sine function.</p>
<p class="rubric">Explanation</p>
<p>This function is one solution of the Mathieu differential equation:</p>
<div class="math notranslate nohighlight">
\[y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0\]</div>
<p>The other solution is the Mathieu Cosine function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span><span class="p">,</span> <span class="n">mathieusprime</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieusprime</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">mathieusprime(a, q, z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieusprime</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">sqrt(a)*cos(sqrt(a)*z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">mathieusprime</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">(-a + 2*q*cos(2*z))*mathieus(a, q, z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieus" title="sympy.functions.special.mathieu_functions.mathieus"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieus</span></code></a></dt><dd><p>Mathieu sine function</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieuc" title="sympy.functions.special.mathieu_functions.mathieuc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieuc</span></code></a></dt><dd><p>Mathieu cosine function</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieucprime" title="sympy.functions.special.mathieu_functions.mathieucprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieucprime</span></code></a></dt><dd><p>Derivative of Mathieu cosine function</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r426"><span class="brackets"><a class="fn-backref" href="#id143">R426</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Mathieu_function">https://en.wikipedia.org/wiki/Mathieu_function</a></p>
</dd>
<dt class="label" id="r427"><span class="brackets"><a class="fn-backref" href="#id144">R427</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/28">http://dlmf.nist.gov/28</a></p>
</dd>
<dt class="label" id="r428"><span class="brackets"><a class="fn-backref" href="#id145">R428</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/MathieuBase.html">http://mathworld.wolfram.com/MathieuBase.html</a></p>
</dd>
<dt class="label" id="r429"><span class="brackets"><a class="fn-backref" href="#id146">R429</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuSPrime/">http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuSPrime/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.mathieu_functions.mathieucprime">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.mathieu_functions.</span></span><span class="sig-name descname"><span class="pre">mathieucprime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">q</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">z</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/mathieu_functions.py#L210-L269"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.mathieu_functions.mathieucprime" title="Permalink to this definition">¶</a></dt>
<dd><p>The derivative <span class="math notranslate nohighlight">\(C^{\prime}(a,q,z)\)</span> of the Mathieu Cosine function.</p>
<p class="rubric">Explanation</p>
<p>This function is one solution of the Mathieu differential equation:</p>
<div class="math notranslate nohighlight">
\[y(x)^{\prime\prime} + (a - 2 q \cos(2 x)) y(x) = 0\]</div>
<p>The other solution is the Mathieu Sine function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">diff</span><span class="p">,</span> <span class="n">mathieucprime</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieucprime</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">mathieucprime(a, q, z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">mathieucprime</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span>
<span class="go">-sqrt(a)*sin(sqrt(a)*z)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">mathieucprime</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">q</span><span class="p">,</span> <span class="n">z</span><span class="p">),</span> <span class="n">z</span><span class="p">)</span>
<span class="go">(-a + 2*q*cos(2*z))*mathieuc(a, q, z)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<dl class="simple">
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieus" title="sympy.functions.special.mathieu_functions.mathieus"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieus</span></code></a></dt><dd><p>Mathieu sine function</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieuc" title="sympy.functions.special.mathieu_functions.mathieuc"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieuc</span></code></a></dt><dd><p>Mathieu cosine function</p>
</dd>
<dt><a class="reference internal" href="#sympy.functions.special.mathieu_functions.mathieusprime" title="sympy.functions.special.mathieu_functions.mathieusprime"><code class="xref py py-obj docutils literal notranslate"><span class="pre">mathieusprime</span></code></a></dt><dd><p>Derivative of Mathieu sine function</p>
</dd>
</dl>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r430"><span class="brackets"><a class="fn-backref" href="#id147">R430</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Mathieu_function">https://en.wikipedia.org/wiki/Mathieu_function</a></p>
</dd>
<dt class="label" id="r431"><span class="brackets"><a class="fn-backref" href="#id148">R431</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/28">http://dlmf.nist.gov/28</a></p>
</dd>
<dt class="label" id="r432"><span class="brackets"><a class="fn-backref" href="#id149">R432</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/MathieuBase.html">http://mathworld.wolfram.com/MathieuBase.html</a></p>
</dd>
<dt class="label" id="r433"><span class="brackets"><a class="fn-backref" href="#id150">R433</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuCPrime/">http://functions.wolfram.com/MathieuandSpheroidalFunctions/MathieuCPrime/</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-sympy.functions.special.polynomials">
<span id="orthogonal-polynomials"></span><h2>Orthogonal Polynomials<a class="headerlink" href="#module-sympy.functions.special.polynomials" title="Permalink to this headline">¶</a></h2>
<p>This module mainly implements special orthogonal polynomials.</p>
<p>See also functions.combinatorial.numbers which contains some
combinatorial polynomials.</p>
<section id="jacobi-polynomials">
<h3>Jacobi Polynomials<a class="headerlink" href="#jacobi-polynomials" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.jacobi">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">jacobi</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L52-L211"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.jacobi" title="Permalink to this definition">¶</a></dt>
<dd><p>Jacobi polynomial <span class="math notranslate nohighlight">\(P_n^{\left(\alpha, \beta\right)}(x)\)</span>.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">jacobi(n,</span> <span class="pre">alpha,</span> <span class="pre">beta,</span> <span class="pre">x)</span></code> gives the nth Jacobi polynomial
in x, <span class="math notranslate nohighlight">\(P_n^{\left(\alpha, \beta\right)}(x)\)</span>.</p>
<p>The Jacobi polynomials are orthogonal on <span class="math notranslate nohighlight">\([-1, 1]\)</span> with respect
to the weight <span class="math notranslate nohighlight">\(\left(1-x\right)^\alpha \left(1+x\right)^\beta\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">jacobi</span><span class="p">,</span> <span class="n">S</span><span class="p">,</span> <span class="n">conjugate</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">a/2 - b/2 + x*(a/2 + b/2 + 1)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">a**2/8 - a*b/4 - a/8 + b**2/8 - b/8 + x**2*(a**2/8 + a*b/4 + 7*a/8 + b**2/8 + 7*b/8 + 3/2) + x*(a**2/4 + 3*a/4 - b**2/4 - 3*b/4) - 1/2</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">jacobi(n, a, b, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">RisingFactorial(a + 1, n)*gegenbauer(n,</span>
<span class="go">    a + 1/2, x)/RisingFactorial(2*a + 1, n)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">legendre(n, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">RisingFactorial(3/2, n)*chebyshevu(n, x)/factorial(n + 1)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="o">-</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">RisingFactorial(1/2, n)*chebyshevt(n, x)/factorial(n)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="o">-</span><span class="n">x</span><span class="p">)</span>
<span class="go">(-1)**n*jacobi(n, b, a, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">gamma(a + n + 1)*hyper((-b - n, -n), (a + 1,), -1)/(2**n*factorial(n)*gamma(a + 1))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">RisingFactorial(a + 1, n)/factorial(n)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">x</span><span class="p">))</span>
<span class="go">jacobi(n, conjugate(a), conjugate(b), conjugate(x))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">jacobi</span><span class="p">(</span><span class="n">n</span><span class="p">,</span><span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">(a/2 + b/2 + n/2 + 1/2)*jacobi(n - 1, a + 1, b + 1, x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r434"><span class="brackets"><a class="fn-backref" href="#id151">R434</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Jacobi_polynomials">https://en.wikipedia.org/wiki/Jacobi_polynomials</a></p>
</dd>
<dt class="label" id="r435"><span class="brackets"><a class="fn-backref" href="#id152">R435</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/JacobiPolynomial.html">http://mathworld.wolfram.com/JacobiPolynomial.html</a></p>
</dd>
<dt class="label" id="r436"><span class="brackets"><a class="fn-backref" href="#id153">R436</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/JacobiP/">http://functions.wolfram.com/Polynomials/JacobiP/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.jacobi_normalized">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">jacobi_normalized</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">b</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L214-L284"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.jacobi_normalized" title="Permalink to this definition">¶</a></dt>
<dd><p>Jacobi polynomial <span class="math notranslate nohighlight">\(P_n^{\left(\alpha, \beta\right)}(x)\)</span>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : integer degree of polynomial</p>
<p><strong>a</strong> : alpha value</p>
<p><strong>b</strong> : beta value</p>
<p><strong>x</strong> : symbol</p>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">jacobi_normalized(n,</span> <span class="pre">alpha,</span> <span class="pre">beta,</span> <span class="pre">x)</span></code> gives the nth
Jacobi polynomial in <em>x</em>, <span class="math notranslate nohighlight">\(P_n^{\left(\alpha, \beta\right)}(x)\)</span>.</p>
<p>The Jacobi polynomials are orthogonal on <span class="math notranslate nohighlight">\([-1, 1]\)</span> with respect
to the weight <span class="math notranslate nohighlight">\(\left(1-x\right)^\alpha \left(1+x\right)^\beta\)</span>.</p>
<p>This functions returns the polynomials normilzed:</p>
<div class="math notranslate nohighlight">
\[\int_{-1}^{1}
  P_m^{\left(\alpha, \beta\right)}(x)
  P_n^{\left(\alpha, \beta\right)}(x)
  (1-x)^{\alpha} (1+x)^{\beta} \mathrm{d}x
= \delta_{m,n}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">jacobi_normalized</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">x</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">jacobi_normalized</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">jacobi(n, a, b, x)/sqrt(2**(a + b + 1)*gamma(a + n + 1)*gamma(b + n + 1)/((a + b + 2*n + 1)*factorial(n)*gamma(a + b + n + 1)))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r437"><span class="brackets"><a class="fn-backref" href="#id154">R437</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Jacobi_polynomials">https://en.wikipedia.org/wiki/Jacobi_polynomials</a></p>
</dd>
<dt class="label" id="r438"><span class="brackets"><a class="fn-backref" href="#id155">R438</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/JacobiPolynomial.html">http://mathworld.wolfram.com/JacobiPolynomial.html</a></p>
</dd>
<dt class="label" id="r439"><span class="brackets"><a class="fn-backref" href="#id156">R439</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/JacobiP/">http://functions.wolfram.com/Polynomials/JacobiP/</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="gegenbauer-polynomials">
<h3>Gegenbauer Polynomials<a class="headerlink" href="#gegenbauer-polynomials" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.gegenbauer">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">gegenbauer</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">a</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L292-L432"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.gegenbauer" title="Permalink to this definition">¶</a></dt>
<dd><p>Gegenbauer polynomial <span class="math notranslate nohighlight">\(C_n^{\left(\alpha\right)}(x)\)</span>.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">gegenbauer(n,</span> <span class="pre">alpha,</span> <span class="pre">x)</span></code> gives the nth Gegenbauer polynomial
in x, <span class="math notranslate nohighlight">\(C_n^{\left(\alpha\right)}(x)\)</span>.</p>
<p>The Gegenbauer polynomials are orthogonal on <span class="math notranslate nohighlight">\([-1, 1]\)</span> with
respect to the weight <span class="math notranslate nohighlight">\(\left(1-x^2\right)^{\alpha-\frac{1}{2}}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">gegenbauer</span><span class="p">,</span> <span class="n">conjugate</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">a</span><span class="p">,</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*a*x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-a + x**2*(2*a**2 + 2*a)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x**3*(4*a**3/3 + 4*a**2 + 8*a/3) + x*(-2*a**2 - 2*a)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">gegenbauer(n, a, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="o">-</span><span class="n">x</span><span class="p">)</span>
<span class="go">(-1)**n*gegenbauer(n, a, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">2**n*sqrt(pi)*gamma(a + n/2)/(gamma(a)*gamma(1/2 - n/2)*gamma(n + 1))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">gegenbauer</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">gamma(2*a + n)/(gamma(2*a)*gamma(n + 1))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">gegenbauer</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">))</span>
<span class="go">gegenbauer(n, conjugate(a), conjugate(x))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">gegenbauer</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*a*gegenbauer(n - 1, a + 1, x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r440"><span class="brackets"><a class="fn-backref" href="#id157">R440</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Gegenbauer_polynomials">https://en.wikipedia.org/wiki/Gegenbauer_polynomials</a></p>
</dd>
<dt class="label" id="r441"><span class="brackets"><a class="fn-backref" href="#id158">R441</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/GegenbauerPolynomial.html">http://mathworld.wolfram.com/GegenbauerPolynomial.html</a></p>
</dd>
<dt class="label" id="r442"><span class="brackets"><a class="fn-backref" href="#id159">R442</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/GegenbauerC3/">http://functions.wolfram.com/Polynomials/GegenbauerC3/</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="chebyshev-polynomials">
<h3>Chebyshev Polynomials<a class="headerlink" href="#chebyshev-polynomials" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.chebyshevt">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">chebyshevt</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L439-L548"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.chebyshevt" title="Permalink to this definition">¶</a></dt>
<dd><p>Chebyshev polynomial of the first kind, <span class="math notranslate nohighlight">\(T_n(x)\)</span>.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">chebyshevt(n,</span> <span class="pre">x)</span></code> gives the nth Chebyshev polynomial (of the first
kind) in x, <span class="math notranslate nohighlight">\(T_n(x)\)</span>.</p>
<p>The Chebyshev polynomials of the first kind are orthogonal on
<span class="math notranslate nohighlight">\([-1, 1]\)</span> with respect to the weight <span class="math notranslate nohighlight">\(\frac{1}{\sqrt{1-x^2}}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">chebyshevt</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*x**2 - 1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">chebyshevt(n, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="o">-</span><span class="n">x</span><span class="p">)</span>
<span class="go">(-1)**n*chebyshevt(n, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="o">-</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">chebyshevt(n, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">cos(pi*n/2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span>
<span class="go">(-1)**n</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">chebyshevt</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">n*chebyshevu(n - 1, x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r443"><span class="brackets"><a class="fn-backref" href="#id160">R443</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Chebyshev_polynomial">https://en.wikipedia.org/wiki/Chebyshev_polynomial</a></p>
</dd>
<dt class="label" id="r444"><span class="brackets"><a class="fn-backref" href="#id161">R444</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html">http://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html</a></p>
</dd>
<dt class="label" id="r445"><span class="brackets"><a class="fn-backref" href="#id162">R445</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/ChebyshevPolynomialoftheSecondKind.html">http://mathworld.wolfram.com/ChebyshevPolynomialoftheSecondKind.html</a></p>
</dd>
<dt class="label" id="r446"><span class="brackets"><a class="fn-backref" href="#id163">R446</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/ChebyshevT/">http://functions.wolfram.com/Polynomials/ChebyshevT/</a></p>
</dd>
<dt class="label" id="r447"><span class="brackets"><a class="fn-backref" href="#id164">R447</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/ChebyshevU/">http://functions.wolfram.com/Polynomials/ChebyshevU/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.chebyshevu">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">chebyshevu</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L551-L668"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.chebyshevu" title="Permalink to this definition">¶</a></dt>
<dd><p>Chebyshev polynomial of the second kind, <span class="math notranslate nohighlight">\(U_n(x)\)</span>.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">chebyshevu(n,</span> <span class="pre">x)</span></code> gives the nth Chebyshev polynomial of the second
kind in x, <span class="math notranslate nohighlight">\(U_n(x)\)</span>.</p>
<p>The Chebyshev polynomials of the second kind are orthogonal on
<span class="math notranslate nohighlight">\([-1, 1]\)</span> with respect to the weight <span class="math notranslate nohighlight">\(\sqrt{1-x^2}\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">chebyshevu</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">4*x**2 - 1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">chebyshevu(n, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="o">-</span><span class="n">x</span><span class="p">)</span>
<span class="go">(-1)**n*chebyshevu(n, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="o">-</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-chebyshevu(n - 2, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">cos(pi*n/2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">n + 1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">chebyshevu</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">(-x*chebyshevu(n, x) + (n + 1)*chebyshevt(n + 1, x))/(x**2 - 1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r448"><span class="brackets"><a class="fn-backref" href="#id165">R448</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Chebyshev_polynomial">https://en.wikipedia.org/wiki/Chebyshev_polynomial</a></p>
</dd>
<dt class="label" id="r449"><span class="brackets"><a class="fn-backref" href="#id166">R449</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html">http://mathworld.wolfram.com/ChebyshevPolynomialoftheFirstKind.html</a></p>
</dd>
<dt class="label" id="r450"><span class="brackets"><a class="fn-backref" href="#id167">R450</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/ChebyshevPolynomialoftheSecondKind.html">http://mathworld.wolfram.com/ChebyshevPolynomialoftheSecondKind.html</a></p>
</dd>
<dt class="label" id="r451"><span class="brackets"><a class="fn-backref" href="#id168">R451</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/ChebyshevT/">http://functions.wolfram.com/Polynomials/ChebyshevT/</a></p>
</dd>
<dt class="label" id="r452"><span class="brackets"><a class="fn-backref" href="#id169">R452</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/ChebyshevU/">http://functions.wolfram.com/Polynomials/ChebyshevU/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.chebyshevt_root">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">chebyshevt_root</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L671-L708"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.chebyshevt_root" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal notranslate"><span class="pre">chebyshev_root(n,</span> <span class="pre">k)</span></code> returns the kth root (indexed from zero) of
the nth Chebyshev polynomial of the first kind; that is, if
0 &lt;= k &lt; n, <code class="docutils literal notranslate"><span class="pre">chebyshevt(n,</span> <span class="pre">chebyshevt_root(n,</span> <span class="pre">k))</span> <span class="pre">==</span> <span class="pre">0</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">chebyshevt</span><span class="p">,</span> <span class="n">chebyshevt_root</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt_root</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-sqrt(3)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevt</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">chebyshevt_root</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.chebyshevu_root">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">chebyshevu_root</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">k</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L711-L748"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.chebyshevu_root" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal notranslate"><span class="pre">chebyshevu_root(n,</span> <span class="pre">k)</span></code> returns the kth root (indexed from zero) of the
nth Chebyshev polynomial of the second kind; that is, if 0 &lt;= k &lt; n,
<code class="docutils literal notranslate"><span class="pre">chebyshevu(n,</span> <span class="pre">chebyshevu_root(n,</span> <span class="pre">k))</span> <span class="pre">==</span> <span class="pre">0</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">chebyshevu</span><span class="p">,</span> <span class="n">chebyshevu_root</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu_root</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-sqrt(2)/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">chebyshevu</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">chebyshevu_root</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
</dd></dl>

</section>
<section id="legendre-polynomials">
<h3>Legendre Polynomials<a class="headerlink" href="#legendre-polynomials" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.legendre">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">legendre</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L755-L862"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.legendre" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal notranslate"><span class="pre">legendre(n,</span> <span class="pre">x)</span></code> gives the nth Legendre polynomial of x, <span class="math notranslate nohighlight">\(P_n(x)\)</span></p>
<p class="rubric">Explanation</p>
<p>The Legendre polynomials are orthogonal on [-1, 1] with respect to
the constant weight 1. They satisfy <span class="math notranslate nohighlight">\(P_n(1) = 1\)</span> for all n; further,
<span class="math notranslate nohighlight">\(P_n\)</span> is odd for odd n and even for even n.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">legendre</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">legendre</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">legendre</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">legendre</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">3*x**2/2 - 1/2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">legendre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">legendre(n, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">legendre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">n*(x*legendre(n, x) - legendre(n - 1, x))/(x**2 - 1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r453"><span class="brackets"><a class="fn-backref" href="#id170">R453</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Legendre_polynomial">https://en.wikipedia.org/wiki/Legendre_polynomial</a></p>
</dd>
<dt class="label" id="r454"><span class="brackets"><a class="fn-backref" href="#id171">R454</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/LegendrePolynomial.html">http://mathworld.wolfram.com/LegendrePolynomial.html</a></p>
</dd>
<dt class="label" id="r455"><span class="brackets"><a class="fn-backref" href="#id172">R455</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LegendreP/">http://functions.wolfram.com/Polynomials/LegendreP/</a></p>
</dd>
<dt class="label" id="r456"><span class="brackets"><a class="fn-backref" href="#id173">R456</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LegendreP2/">http://functions.wolfram.com/Polynomials/LegendreP2/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.assoc_legendre">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">assoc_legendre</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L865-L969"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.assoc_legendre" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal notranslate"><span class="pre">assoc_legendre(n,</span> <span class="pre">m,</span> <span class="pre">x)</span></code> gives <span class="math notranslate nohighlight">\(P_n^m(x)\)</span>, where n and m are
the degree and order or an expression which is related to the nth
order Legendre polynomial, <span class="math notranslate nohighlight">\(P_n(x)\)</span> in the following manner:</p>
<div class="math notranslate nohighlight">
\[P_n^m(x) = (-1)^m (1 - x^2)^{\frac{m}{2}}
           \frac{\mathrm{d}^m P_n(x)}{\mathrm{d} x^m}\]</div>
<p class="rubric">Explanation</p>
<p>Associated Legendre polynomials are orthogonal on [-1, 1] with:</p>
<ul class="simple">
<li><p>weight = 1            for the same m, and different n.</p></li>
<li><p>weight = 1/(1-x**2)   for the same n, and different m.</p></li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">assoc_legendre</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_legendre</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_legendre</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_legendre</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-sqrt(1 - x**2)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_legendre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span><span class="n">m</span><span class="p">,</span><span class="n">x</span><span class="p">)</span>
<span class="go">assoc_legendre(n, m, x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r457"><span class="brackets"><a class="fn-backref" href="#id174">R457</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Associated_Legendre_polynomials">https://en.wikipedia.org/wiki/Associated_Legendre_polynomials</a></p>
</dd>
<dt class="label" id="r458"><span class="brackets"><a class="fn-backref" href="#id175">R458</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/LegendrePolynomial.html">http://mathworld.wolfram.com/LegendrePolynomial.html</a></p>
</dd>
<dt class="label" id="r459"><span class="brackets"><a class="fn-backref" href="#id176">R459</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LegendreP/">http://functions.wolfram.com/Polynomials/LegendreP/</a></p>
</dd>
<dt class="label" id="r460"><span class="brackets"><a class="fn-backref" href="#id177">R460</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LegendreP2/">http://functions.wolfram.com/Polynomials/LegendreP2/</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="hermite-polynomials">
<h3>Hermite Polynomials<a class="headerlink" href="#hermite-polynomials" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.hermite">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">hermite</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L976-L1065"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.hermite" title="Permalink to this definition">¶</a></dt>
<dd><p><code class="docutils literal notranslate"><span class="pre">hermite(n,</span> <span class="pre">x)</span></code> gives the nth Hermite polynomial in x, <span class="math notranslate nohighlight">\(H_n(x)\)</span></p>
<p class="rubric">Explanation</p>
<p>The Hermite polynomials are orthogonal on <span class="math notranslate nohighlight">\((-\infty, \infty)\)</span>
with respect to the weight <span class="math notranslate nohighlight">\(\exp\left(-x^2\right)\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">hermite</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hermite</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hermite</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hermite</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">4*x**2 - 2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hermite</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">hermite(n, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">hermite</span><span class="p">(</span><span class="n">n</span><span class="p">,</span><span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">2*n*hermite(n - 1, x)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hermite</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="o">-</span><span class="n">x</span><span class="p">)</span>
<span class="go">(-1)**n*hermite(n, x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r461"><span class="brackets"><a class="fn-backref" href="#id178">R461</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Hermite_polynomial">https://en.wikipedia.org/wiki/Hermite_polynomial</a></p>
</dd>
<dt class="label" id="r462"><span class="brackets"><a class="fn-backref" href="#id179">R462</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/HermitePolynomial.html">http://mathworld.wolfram.com/HermitePolynomial.html</a></p>
</dd>
<dt class="label" id="r463"><span class="brackets"><a class="fn-backref" href="#id180">R463</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/HermiteH/">http://functions.wolfram.com/Polynomials/HermiteH/</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="laguerre-polynomials">
<h3>Laguerre Polynomials<a class="headerlink" href="#laguerre-polynomials" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.laguerre">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">laguerre</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L1072-L1173"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.laguerre" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the nth Laguerre polynomial in x, <span class="math notranslate nohighlight">\(L_n(x)\)</span>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : int</p>
<blockquote>
<div><p>Degree of Laguerre polynomial. Must be <code class="docutils literal notranslate"><span class="pre">n</span> <span class="pre">&gt;=</span> <span class="pre">0</span></code>.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">laguerre</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">n</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">laguerre</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">laguerre</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1 - x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">laguerre</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">x**2/2 - 2*x + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">laguerre</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-x**3/6 + 3*x**2/2 - 3*x + 1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">laguerre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">laguerre(n, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">laguerre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-assoc_laguerre(n - 1, 1, x)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_laguerre" title="sympy.functions.special.polynomials.assoc_laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r464"><span class="brackets"><a class="fn-backref" href="#id181">R464</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Laguerre_polynomial">https://en.wikipedia.org/wiki/Laguerre_polynomial</a></p>
</dd>
<dt class="label" id="r465"><span class="brackets"><a class="fn-backref" href="#id182">R465</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/LaguerrePolynomial.html">http://mathworld.wolfram.com/LaguerrePolynomial.html</a></p>
</dd>
<dt class="label" id="r466"><span class="brackets"><a class="fn-backref" href="#id183">R466</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LaguerreL/">http://functions.wolfram.com/Polynomials/LaguerreL/</a></p>
</dd>
<dt class="label" id="r467"><span class="brackets"><a class="fn-backref" href="#id184">R467</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LaguerreL3/">http://functions.wolfram.com/Polynomials/LaguerreL3/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.polynomials.assoc_laguerre">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.polynomials.</span></span><span class="sig-name descname"><span class="pre">assoc_laguerre</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alpha</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">x</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/polynomials.py#L1176-L1297"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.polynomials.assoc_laguerre" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the nth generalized Laguerre polynomial in x, <span class="math notranslate nohighlight">\(L_n(x)\)</span>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>n</strong> : int</p>
<blockquote>
<div><p>Degree of Laguerre polynomial. Must be <code class="docutils literal notranslate"><span class="pre">n</span> <span class="pre">&gt;=</span> <span class="pre">0</span></code>.</p>
</div></blockquote>
<p><strong>alpha</strong> : Expr</p>
<blockquote>
<div><p>Arbitrary expression. For <code class="docutils literal notranslate"><span class="pre">alpha=0</span></code> regular Laguerre
polynomials will be generated.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">assoc_laguerre</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">n</span><span class="p">,</span> <span class="n">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">a - x + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">a**2/2 + 3*a/2 + x**2/2 + x*(-a - 2) + 1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">a**3/6 + a**2 + 11*a/6 - x**3/6 + x**2*(a/2 + 3/2) +</span>
<span class="go">    x*(-a**2/2 - 5*a/2 - 3) + 1</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span>
<span class="go">binomial(a + n, a)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">assoc_laguerre(n, a, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">x</span><span class="p">)</span>
<span class="go">laguerre(n, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">x</span><span class="p">)</span>
<span class="go">-assoc_laguerre(n - 1, a + 1, x)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">assoc_laguerre</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">a</span><span class="p">,</span> <span class="n">x</span><span class="p">),</span> <span class="n">a</span><span class="p">)</span>
<span class="go">Sum(assoc_laguerre(_k, a, x)/(-a + n), (_k, 0, n - 1))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.polynomials.jacobi" title="sympy.functions.special.polynomials.jacobi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">jacobi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.gegenbauer" title="sympy.functions.special.polynomials.gegenbauer"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gegenbauer</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt" title="sympy.functions.special.polynomials.chebyshevt"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevt_root" title="sympy.functions.special.polynomials.chebyshevt_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevt_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu" title="sympy.functions.special.polynomials.chebyshevu"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.chebyshevu_root" title="sympy.functions.special.polynomials.chebyshevu_root"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chebyshevu_root</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.legendre" title="sympy.functions.special.polynomials.legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.assoc_legendre" title="sympy.functions.special.polynomials.assoc_legendre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">assoc_legendre</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.hermite" title="sympy.functions.special.polynomials.hermite"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hermite</span></code></a>, <a class="reference internal" href="#sympy.functions.special.polynomials.laguerre" title="sympy.functions.special.polynomials.laguerre"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laguerre</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.jacobi_poly" title="sympy.polys.orthopolys.jacobi_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.jacobi_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.gegenbauer_poly" title="sympy.polys.orthopolys.gegenbauer_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.gegenbauer_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevt_poly" title="sympy.polys.orthopolys.chebyshevt_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevt_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.chebyshevu_poly" title="sympy.polys.orthopolys.chebyshevu_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.chebyshevu_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.hermite_poly" title="sympy.polys.orthopolys.hermite_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.hermite_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.legendre_poly" title="sympy.polys.orthopolys.legendre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.legendre_poly</span></code></a>, <a class="reference internal" href="../polys/reference.html#sympy.polys.orthopolys.laguerre_poly" title="sympy.polys.orthopolys.laguerre_poly"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sympy.polys.orthopolys.laguerre_poly</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r468"><span class="brackets"><a class="fn-backref" href="#id185">R468</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Laguerre_polynomial#Generalized_Laguerre_polynomials">https://en.wikipedia.org/wiki/Laguerre_polynomial#Generalized_Laguerre_polynomials</a></p>
</dd>
<dt class="label" id="r469"><span class="brackets"><a class="fn-backref" href="#id186">R469</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/AssociatedLaguerrePolynomial.html">http://mathworld.wolfram.com/AssociatedLaguerrePolynomial.html</a></p>
</dd>
<dt class="label" id="r470"><span class="brackets"><a class="fn-backref" href="#id187">R470</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LaguerreL/">http://functions.wolfram.com/Polynomials/LaguerreL/</a></p>
</dd>
<dt class="label" id="r471"><span class="brackets"><a class="fn-backref" href="#id188">R471</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/LaguerreL3/">http://functions.wolfram.com/Polynomials/LaguerreL3/</a></p>
</dd>
</dl>
</dd></dl>

</section>
</section>
<section id="spherical-harmonics">
<h2>Spherical Harmonics<a class="headerlink" href="#spherical-harmonics" title="Permalink to this headline">¶</a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.spherical_harmonics.Ynm">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.spherical_harmonics.</span></span><span class="sig-name descname"><span class="pre">Ynm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">theta</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">phi</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/spherical_harmonics.py#L14-L223"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.spherical_harmonics.Ynm" title="Permalink to this definition">¶</a></dt>
<dd><p>Spherical harmonics defined as</p>
<div class="math notranslate nohighlight">
\[Y_n^m(\theta, \varphi) := \sqrt{\frac{(2n+1)(n-m)!}{4\pi(n+m)!}}
                          \exp(i m \varphi)
                          \mathrm{P}_n^m\left(\cos(\theta)\right)\]</div>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Ynm()</span></code> gives the spherical harmonic function of order <span class="math notranslate nohighlight">\(n\)</span> and <span class="math notranslate nohighlight">\(m\)</span>
in <span class="math notranslate nohighlight">\(\theta\)</span> and <span class="math notranslate nohighlight">\(\varphi\)</span>, <span class="math notranslate nohighlight">\(Y_n^m(\theta, \varphi)\)</span>. The four
parameters are as follows: <span class="math notranslate nohighlight">\(n \geq 0\)</span> an integer and <span class="math notranslate nohighlight">\(m\)</span> an integer
such that <span class="math notranslate nohighlight">\(-n \leq m \leq n\)</span> holds. The two angles are real-valued
with <span class="math notranslate nohighlight">\(\theta \in [0, \pi]\)</span> and <span class="math notranslate nohighlight">\(\varphi \in [0, 2\pi]\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ynm</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">simplify</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">theta</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;theta&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phi</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;phi&quot;</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span>
<span class="go">Ynm(n, m, theta, phi)</span>
</pre></div>
</div>
<p>Several symmetries are known, for the order:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="o">-</span><span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span>
<span class="go">(-1)**m*exp(-2*I*m*phi)*Ynm(n, m, theta, phi)</span>
</pre></div>
</div>
<p>As well as for the angles:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="o">-</span><span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span>
<span class="go">Ynm(n, m, theta, phi)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="o">-</span><span class="n">phi</span><span class="p">)</span>
<span class="go">exp(-2*I*m*phi)*Ynm(n, m, theta, phi)</span>
</pre></div>
</div>
<p>For specific integers <span class="math notranslate nohighlight">\(n\)</span> and <span class="math notranslate nohighlight">\(m\)</span> we can evaluate the harmonics
to more useful expressions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">1/(2*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">sqrt(6)*exp(-I*phi)*sin(theta)/(4*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">sqrt(3)*cos(theta)/(2*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">-sqrt(6)*exp(I*phi)*sin(theta)/(4*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">2</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">sqrt(30)*exp(-2*I*phi)*sin(theta)**2/(8*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">sqrt(30)*exp(-I*phi)*sin(2*theta)/(8*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">sqrt(5)*(3*cos(theta)**2 - 1)/(4*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">-sqrt(30)*exp(I*phi)*sin(2*theta)/(8*sqrt(pi))</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">sqrt(30)*exp(2*I*phi)*sin(theta)**2/(8*sqrt(pi))</span>
</pre></div>
</div>
<p>We can differentiate the functions with respect
to both angles:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ynm</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">diff</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">theta</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;theta&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phi</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;phi&quot;</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">),</span> <span class="n">theta</span><span class="p">)</span>
<span class="go">m*cot(theta)*Ynm(n, m, theta, phi) + sqrt((-m + n)*(m + n + 1))*exp(-I*phi)*Ynm(n, m + 1, theta, phi)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">diff</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">),</span> <span class="n">phi</span><span class="p">)</span>
<span class="go">I*m*Ynm(n, m, theta, phi)</span>
</pre></div>
</div>
<p>Further we can compute the complex conjugation:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ynm</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">conjugate</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">theta</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;theta&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phi</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;phi&quot;</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">conjugate</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">))</span>
<span class="go">(-1)**(2*m)*exp(-2*I*m*phi)*Ynm(n, m, theta, phi)</span>
</pre></div>
</div>
<p>To get back the well known expressions in spherical
coordinates, we use full expansion:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ynm</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">expand_func</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">theta</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;theta&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phi</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;phi&quot;</span><span class="p">)</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">expand_func</span><span class="p">(</span><span class="n">Ynm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">))</span>
<span class="go">sqrt((2*n + 1)*factorial(-m + n)/factorial(m + n))*exp(I*m*phi)*assoc_legendre(n, m, cos(theta))/(2*sqrt(pi))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.spherical_harmonics.Ynm_c" title="sympy.functions.special.spherical_harmonics.Ynm_c"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ynm_c</span></code></a>, <a class="reference internal" href="#sympy.functions.special.spherical_harmonics.Znm" title="sympy.functions.special.spherical_harmonics.Znm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Znm</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r472"><span class="brackets"><a class="fn-backref" href="#id189">R472</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Spherical_harmonics">https://en.wikipedia.org/wiki/Spherical_harmonics</a></p>
</dd>
<dt class="label" id="r473"><span class="brackets"><a class="fn-backref" href="#id190">R473</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/SphericalHarmonic.html">http://mathworld.wolfram.com/SphericalHarmonic.html</a></p>
</dd>
<dt class="label" id="r474"><span class="brackets"><a class="fn-backref" href="#id191">R474</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/SphericalHarmonicY/">http://functions.wolfram.com/Polynomials/SphericalHarmonicY/</a></p>
</dd>
<dt class="label" id="r475"><span class="brackets"><a class="fn-backref" href="#id192">R475</a></span></dt>
<dd><p><a class="reference external" href="http://dlmf.nist.gov/14.30">http://dlmf.nist.gov/14.30</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.spherical_harmonics.Ynm_c">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.spherical_harmonics.</span></span><span class="sig-name descname"><span class="pre">Ynm_c</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">theta</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">phi</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/spherical_harmonics.py#L226-L267"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.spherical_harmonics.Ynm_c" title="Permalink to this definition">¶</a></dt>
<dd><p>Conjugate spherical harmonics defined as</p>
<div class="math notranslate nohighlight">
\[\overline{Y_n^m(\theta, \varphi)} := (-1)^m Y_n^{-m}(\theta, \varphi).\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Ynm_c</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">simplify</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span><span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">theta</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;theta&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phi</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;phi&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ynm_c</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span>
<span class="go">(-1)**(2*m)*exp(-2*I*m*phi)*Ynm(n, m, theta, phi)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Ynm_c</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="o">-</span><span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span>
<span class="go">(-1)**(2*m)*exp(-2*I*m*phi)*Ynm(n, m, theta, phi)</span>
</pre></div>
</div>
<p>For specific integers <span class="math notranslate nohighlight">\(n\)</span> and <span class="math notranslate nohighlight">\(m\)</span> we can evaluate the harmonics
to more useful expressions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm_c</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">1/(2*sqrt(pi))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Ynm_c</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">sqrt(6)*exp(I*(-phi + 2*conjugate(phi)))*sin(theta)/(4*sqrt(pi))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.spherical_harmonics.Ynm" title="sympy.functions.special.spherical_harmonics.Ynm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ynm</span></code></a>, <a class="reference internal" href="#sympy.functions.special.spherical_harmonics.Znm" title="sympy.functions.special.spherical_harmonics.Znm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Znm</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r476"><span class="brackets"><a class="fn-backref" href="#id193">R476</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Spherical_harmonics">https://en.wikipedia.org/wiki/Spherical_harmonics</a></p>
</dd>
<dt class="label" id="r477"><span class="brackets"><a class="fn-backref" href="#id194">R477</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/SphericalHarmonic.html">http://mathworld.wolfram.com/SphericalHarmonic.html</a></p>
</dd>
<dt class="label" id="r478"><span class="brackets"><a class="fn-backref" href="#id195">R478</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/SphericalHarmonicY/">http://functions.wolfram.com/Polynomials/SphericalHarmonicY/</a></p>
</dd>
</dl>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.spherical_harmonics.Znm">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.spherical_harmonics.</span></span><span class="sig-name descname"><span class="pre">Znm</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">n</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">m</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">theta</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">phi</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/spherical_harmonics.py#L270-L339"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.spherical_harmonics.Znm" title="Permalink to this definition">¶</a></dt>
<dd><p>Real spherical harmonics defined as</p>
<div class="math notranslate nohighlight">
\[\begin{split}Z_n^m(\theta, \varphi) :=
\begin{cases}
  \frac{Y_n^m(\theta, \varphi) + \overline{Y_n^m(\theta, \varphi)}}{\sqrt{2}} &amp;\quad m &gt; 0 \\
  Y_n^m(\theta, \varphi) &amp;\quad m = 0 \\
  \frac{Y_n^m(\theta, \varphi) - \overline{Y_n^m(\theta, \varphi)}}{i \sqrt{2}} &amp;\quad m &lt; 0 \\
\end{cases}\end{split}\]</div>
<p>which gives in simplified form</p>
<div class="math notranslate nohighlight">
\[\begin{split}Z_n^m(\theta, \varphi) =
\begin{cases}
  \frac{Y_n^m(\theta, \varphi) + (-1)^m Y_n^{-m}(\theta, \varphi)}{\sqrt{2}} &amp;\quad m &gt; 0 \\
  Y_n^m(\theta, \varphi) &amp;\quad m = 0 \\
  \frac{Y_n^m(\theta, \varphi) - (-1)^m Y_n^{-m}(\theta, \varphi)}{i \sqrt{2}} &amp;\quad m &lt; 0 \\
\end{cases}\end{split}\]</div>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Znm</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">simplify</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">n</span><span class="p">,</span> <span class="n">m</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">theta</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;theta&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">phi</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s2">&quot;phi&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Znm</span><span class="p">(</span><span class="n">n</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span>
<span class="go">Znm(n, m, theta, phi)</span>
</pre></div>
</div>
<p>For specific integers n and m we can evaluate the harmonics
to more useful expressions:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Znm</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">1/(2*sqrt(pi))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Znm</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">-sqrt(3)*sin(theta)*cos(phi)/(2*sqrt(pi))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">simplify</span><span class="p">(</span><span class="n">Znm</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="n">theta</span><span class="p">,</span> <span class="n">phi</span><span class="p">)</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">func</span><span class="o">=</span><span class="kc">True</span><span class="p">))</span>
<span class="go">-sqrt(15)*sin(2*theta)*cos(phi)/(4*sqrt(pi))</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.spherical_harmonics.Ynm" title="sympy.functions.special.spherical_harmonics.Ynm"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ynm</span></code></a>, <a class="reference internal" href="#sympy.functions.special.spherical_harmonics.Ynm_c" title="sympy.functions.special.spherical_harmonics.Ynm_c"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Ynm_c</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r479"><span class="brackets"><a class="fn-backref" href="#id196">R479</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Spherical_harmonics">https://en.wikipedia.org/wiki/Spherical_harmonics</a></p>
</dd>
<dt class="label" id="r480"><span class="brackets"><a class="fn-backref" href="#id197">R480</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/SphericalHarmonic.html">http://mathworld.wolfram.com/SphericalHarmonic.html</a></p>
</dd>
<dt class="label" id="r481"><span class="brackets"><a class="fn-backref" href="#id198">R481</a></span></dt>
<dd><p><a class="reference external" href="http://functions.wolfram.com/Polynomials/SphericalHarmonicY/">http://functions.wolfram.com/Polynomials/SphericalHarmonicY/</a></p>
</dd>
</dl>
</dd></dl>

</section>
<section id="tensor-functions">
<h2>Tensor Functions<a class="headerlink" href="#tensor-functions" title="Permalink to this headline">¶</a></h2>
<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.Eijk">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.tensor_functions.</span></span><span class="sig-name descname"><span class="pre">Eijk</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/tensor_functions.py#L13-L25"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.tensor_functions.Eijk" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent the Levi-Civita symbol.</p>
<p>This is a compatibility wrapper to <code class="docutils literal notranslate"><span class="pre">LeviCivita()</span></code>.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.LeviCivita" title="sympy.functions.special.tensor_functions.LeviCivita"><code class="xref py py-obj docutils literal notranslate"><span class="pre">LeviCivita</span></code></a></p>
</div>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.eval_levicivita">
<span class="sig-prename descclassname"><span class="pre">sympy.functions.special.tensor_functions.</span></span><span class="sig-name descname"><span class="pre">eval_levicivita</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/tensor_functions.py#L28-L35"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.tensor_functions.eval_levicivita" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluate Levi-Civita symbol.</p>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.LeviCivita">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.tensor_functions.</span></span><span class="sig-name descname"><span class="pre">LeviCivita</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/tensor_functions.py#L38-L83"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.tensor_functions.LeviCivita" title="Permalink to this definition">¶</a></dt>
<dd><p>Represent the Levi-Civita symbol.</p>
<p class="rubric">Explanation</p>
<p>For even permutations of indices it returns 1, for odd permutations -1, and
for everything else (a repeated index) it returns 0.</p>
<p>Thus it represents an alternating pseudotensor.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">LeviCivita</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">,</span> <span class="n">k</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LeviCivita</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LeviCivita</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">-1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LeviCivita</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LeviCivita</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">,</span> <span class="n">k</span><span class="p">)</span>
<span class="go">LeviCivita(i, j, k)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">LeviCivita</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
<span class="go">0</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.Eijk" title="sympy.functions.special.tensor_functions.Eijk"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Eijk</span></code></a></p>
</div>
</dd></dl>

<dl class="py class">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.functions.special.tensor_functions.</span></span><span class="sig-name descname"><span class="pre">KroneckerDelta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">i</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">j</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delta_range</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/tensor_functions.py#L86-L479"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta" title="Permalink to this definition">¶</a></dt>
<dd><p>The discrete, or Kronecker, delta function.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>i</strong> : Number, Symbol</p>
<blockquote>
<div><p>The first index of the delta function.</p>
</div></blockquote>
<p><strong>j</strong> : Number, Symbol</p>
<blockquote>
<div><p>The second index of the delta function.</p>
</div></blockquote>
</dd>
</dl>
<p class="rubric">Explanation</p>
<p>A function that takes in two integers <span class="math notranslate nohighlight">\(i\)</span> and <span class="math notranslate nohighlight">\(j\)</span>. It returns <span class="math notranslate nohighlight">\(0\)</span> if <span class="math notranslate nohighlight">\(i\)</span>
and <span class="math notranslate nohighlight">\(j\)</span> are not equal, or it returns <span class="math notranslate nohighlight">\(1\)</span> if <span class="math notranslate nohighlight">\(i\)</span> and <span class="math notranslate nohighlight">\(j\)</span> are equal.</p>
<p class="rubric">Examples</p>
<p>An example with integer indices:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="go">1</span>
</pre></div>
</div>
<p>Symbolic indices:</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">,</span> <span class="n">k</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span>
<span class="go">KroneckerDelta(i, j)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="n">k</span><span class="p">)</span>
<span class="go">KroneckerDelta(i, i + k + 1)</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.eval" title="sympy.functions.special.tensor_functions.KroneckerDelta.eval"><code class="xref py py-obj docutils literal notranslate"><span class="pre">eval</span></code></a>, <a class="reference internal" href="#sympy.functions.special.delta_functions.DiracDelta" title="sympy.functions.special.delta_functions.DiracDelta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">DiracDelta</span></code></a></p>
</div>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r482"><span class="brackets"><a class="fn-backref" href="#id199">R482</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Kronecker_delta">https://en.wikipedia.org/wiki/Kronecker_delta</a></p>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.eval">
<em class="property"><span class="pre">classmethod</span> </em><span class="sig-name descname"><span class="pre">eval</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">i</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">j</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">delta_range</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/functions/special/tensor_functions.py#L142-L196"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.eval" title="Permalink to this definition">¶</a></dt>
<dd><p>Evaluates the discrete delta function.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">,</span> <span class="n">k</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span>
<span class="go">KroneckerDelta(i, j)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">i</span> <span class="o">+</span> <span class="mi">1</span> <span class="o">+</span> <span class="n">k</span><span class="p">)</span>
<span class="go">KroneckerDelta(i, i + k + 1)</span>
</pre></div>
</div>
<p># indirect doctest</p>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.indices_contain_equal_information">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">indices_contain_equal_information</span></span><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.indices_contain_equal_information" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns True if indices are either both above or below fermi.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">above_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">)</span><span class="o">.</span><span class="n">indices_contain_equal_information</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">indices_contain_equal_information</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">p</span><span class="p">)</span><span class="o">.</span><span class="n">indices_contain_equal_information</span>
<span class="go">False</span>
</pre></div>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_above_fermi</span></span><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi" title="Permalink to this definition">¶</a></dt>
<dd><p>True if Delta can be non-zero above fermi.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">above_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">is_above_fermi</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">is_above_fermi</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">)</span><span class="o">.</span><span class="n">is_above_fermi</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_below_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_only_below_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_only_above_fermi</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_below_fermi</span></span><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi" title="Permalink to this definition">¶</a></dt>
<dd><p>True if Delta can be non-zero below fermi.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">above_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">is_below_fermi</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">is_below_fermi</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">)</span><span class="o">.</span><span class="n">is_below_fermi</span>
<span class="go">True</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_above_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_only_above_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_only_below_fermi</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_only_above_fermi</span></span><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi" title="Permalink to this definition">¶</a></dt>
<dd><p>True if Delta is restricted to above fermi.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">above_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">is_only_above_fermi</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">)</span><span class="o">.</span><span class="n">is_only_above_fermi</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">is_only_above_fermi</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_above_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_below_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_only_below_fermi</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">is_only_below_fermi</span></span><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_below_fermi" title="Permalink to this definition">¶</a></dt>
<dd><p>True if Delta is restricted to below fermi.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">above_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">q</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;q&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">is_only_below_fermi</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">q</span><span class="p">)</span><span class="o">.</span><span class="n">is_only_below_fermi</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">is_only_below_fermi</span>
<span class="go">False</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_above_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_above_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_below_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_below_fermi</span></code></a>, <a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi" title="sympy.functions.special.tensor_functions.KroneckerDelta.is_only_above_fermi"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_only_above_fermi</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.killable_index">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">killable_index</span></span><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.killable_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the index which is preferred to substitute in the final
expression.</p>
<p class="rubric">Explanation</p>
<p>The index to substitute is the index with less information regarding
fermi level. If indices contain the same information, ‘a’ is preferred
before ‘b’.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">above_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">j</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;j&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">killable_index</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">killable_index</span>
<span class="go">p</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span><span class="o">.</span><span class="n">killable_index</span>
<span class="go">j</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.preferred_index" title="sympy.functions.special.tensor_functions.KroneckerDelta.preferred_index"><code class="xref py py-obj docutils literal notranslate"><span class="pre">preferred_index</span></code></a></p>
</div>
</dd></dl>

<dl class="py property">
<dt class="sig sig-object py" id="sympy.functions.special.tensor_functions.KroneckerDelta.preferred_index">
<em class="property"><span class="pre">property</span> </em><span class="sig-name descname"><span class="pre">preferred_index</span></span><a class="headerlink" href="#sympy.functions.special.tensor_functions.KroneckerDelta.preferred_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the index which is preferred to keep in the final expression.</p>
<p class="rubric">Explanation</p>
<p>The preferred index is the index with more information regarding fermi
level. If indices contain the same information, ‘a’ is preferred before
‘b’.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.functions.special.tensor_functions</span> <span class="kn">import</span> <span class="n">KroneckerDelta</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Symbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;a&#39;</span><span class="p">,</span> <span class="n">above_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">i</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;i&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">j</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;j&#39;</span><span class="p">,</span> <span class="n">below_fermi</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">p</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;p&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">preferred_index</span>
<span class="go">i</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">p</span><span class="p">,</span> <span class="n">a</span><span class="p">)</span><span class="o">.</span><span class="n">preferred_index</span>
<span class="go">a</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">KroneckerDelta</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span><span class="o">.</span><span class="n">preferred_index</span>
<span class="go">i</span>
</pre></div>
</div>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="#sympy.functions.special.tensor_functions.KroneckerDelta.killable_index" title="sympy.functions.special.tensor_functions.KroneckerDelta.killable_index"><code class="xref py py-obj docutils literal notranslate"><span class="pre">killable_index</span></code></a></p>
</div>
</dd></dl>

</dd></dl>

</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Special</a><ul>
<li><a class="reference internal" href="#diracdelta">DiracDelta</a></li>
<li><a class="reference internal" href="#heaviside">Heaviside</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.singularity_functions">Singularity Function</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.gamma_functions">Gamma, Beta and related Functions</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.error_functions">Error Functions and Fresnel Integrals</a></li>
<li><a class="reference internal" href="#exponential-logarithmic-and-trigonometric-integrals">Exponential, Logarithmic and Trigonometric Integrals</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.bessel">Bessel Type Functions</a></li>
<li><a class="reference internal" href="#airy-functions">Airy Functions</a></li>
<li><a class="reference internal" href="#b-splines">B-Splines</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.zeta_functions">Riemann Zeta and Related Functions</a></li>
<li><a class="reference internal" href="#hypergeometric-functions">Hypergeometric Functions</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.elliptic_integrals">Elliptic integrals</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.mathieu_functions">Mathieu Functions</a></li>
<li><a class="reference internal" href="#module-sympy.functions.special.polynomials">Orthogonal Polynomials</a><ul>
<li><a class="reference internal" href="#jacobi-polynomials">Jacobi Polynomials</a></li>
<li><a class="reference internal" href="#gegenbauer-polynomials">Gegenbauer Polynomials</a></li>
<li><a class="reference internal" href="#chebyshev-polynomials">Chebyshev Polynomials</a></li>
<li><a class="reference internal" href="#legendre-polynomials">Legendre Polynomials</a></li>
<li><a class="reference internal" href="#hermite-polynomials">Hermite Polynomials</a></li>
<li><a class="reference internal" href="#laguerre-polynomials">Laguerre Polynomials</a></li>
</ul>
</li>
<li><a class="reference internal" href="#spherical-harmonics">Spherical Harmonics</a></li>
<li><a class="reference internal" href="#tensor-functions">Tensor Functions</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="combinatorial.html"
                        title="previous chapter">Combinatorial</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../geometry/index.html"
                        title="next chapter">Geometry</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/functions/special.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../geometry/index.html" title="Geometry"
             >next</a> |</li>
        <li class="right" >
          <a href="combinatorial.html" title="Combinatorial"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Functions</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Special</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/functions/special.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:26:13 GMT -->
</html>